I accidentally indexed a config file that shouldn't be indexed in git.
To remove it, I added it to my .gitignore
file and did :
git rm --cached myfile.conf
Now, when I checkout a previous commit (before the deletion) and that I come back to my previous HEAD, git remove myfile.conf from my local file system.
How to avoid this ?