Sometimes git suggests git rm --cached to unstage a file, sometimes git reset HEAD file. When should I use which?
EDIT:
D:\
Let's say you stage a whole directory via git add , but you want to exclude a file from the staged list (i.e. the list that generates when running git status) and keep the modifications within the excluded file (you were working on something and it's not ready for commit, but you don't want to lose your work...). You could simply use:
git reset
When you run git status, you will see that whatever file(s) you reset are unstaged and the rest of the files you added are still in the staged list.