Remove a file from a Git repository without deleting it from the local filesystem https://stackoverflow.com/questions/1143796/remove-a-file-from-a-git-repository-without-deleting-it-from-the-local-filesyste
git rm --cached mylogfile.log
For a directory:
git rm --cached -r mydirectory