Last Updated: February 25, 2016
·
911
· tonylinnabery

"Un-index" a directory in git

You've added a directory to the gitignore file, however this directory has been previously indexed. Fortunately you can still ignore this directory, but you'll need to clear it from your current index by running the following code:

git rm -r --cached /path/to/dir;

Source:
http://www.kernel.org/pub/software/scm/git/docs/gitignore.html