Posted By: Anonymous
I deleted some files.
I did NOT commit yet.
I want to reset my workspace to recover the files.
I did a
git checkout ..
But the deleted files are still missing.
git status shows:
# On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # deleted: cc.properties # deleted: store/README # deleted: store/cc.properties #
git checkout . reset the workspace to
The output tells you what you need to do.
git reset HEAD cc.properties 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 -- cc.properties 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.