apply gitignore to previous commits code example Example: apply gitignore after commit git rm --cached $file