Wednesday, December 14, 2011

How to restore locally deleted file in git

If you have not committed yet then find the last commit 
git rev-list -n 1 HEAD -- <file_path> 

Then checkout the version at the commit before.
git checkout <deleting_commit>^ -- <file_path>

No comments:

Post a Comment