git delete file after gitignore code example Example 1: github untrack files git rm -r --cached . Example 2: git remove file from gitignore git rm --cached <file>