git recover deleted file where no commit was made after the delete

The output tells you what you need to do. git reset HEAD etc.

This will unstage the rm operation. After that, running a git status again will tell you that you need to do a git checkout -- to get the file back.

I have this in my config file

$ git config alias.unstage
reset HEAD

which I usually use to unstage stuff.

Leave a Comment