git remove cached

C++
$ git rm -r --cached .git rm -r --cached <name-of-dir>$ git rm --cached filename
Source

Also in C++: