git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
git ls-files --ignored --exclude-standard -z | xargs -0 git rm --cached git commit -am "Remove ignored files" // answer from: thSoft