how to remove cache a file with gitignore code example Example: git rm cached gitignore git rm -r --cached .