git remove folder from gitignore code example
Example 1: git remove all files in gitignore
git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
Example 2: how to remove a pushed file from git
git checkout HEAD^ -- /path/to/file