I removed test.txt file with this command:
git rm test.txt
then git status result was as:
Then I tried this command:
git reset head test.txt
to unstage changes and the result:
and finally I tried to remove the txt file with this command:
git rm test.txt
but the command unexpectedly **staged **the file instead of **removing **it:
Could you please explain misunderstanding with this command?
>Solution :
git rm test.txt not only records the test.txt deletion in the Git index, but also removes it from your working tree (local disk).
Unstaging the deletion still leaves the text.txt deleted on disk.
A new git rm simply re-stage the deletion.
If you had done a git rm --cached test.txt, then unstaging the deletion would have left a clean git status.


