How to recover files added to git but overwritten by checkout
This question already has an answer here:
Okay, I fixed it. It is possible to recover files that have been added to the index. It is possible to recover the files only if they have either been added or stashed.
Here are the steps:
Step 1:
git fsck −−lost-found
This will give you a list of dangling blob IDs - the stuff you added and did not commit (before doing the force checkout)
Step 2:
git show <ID>
This is the ID associated with that dangling blob. It will spit the contents of the file to the console.
That's it!
This thread helped me: Recover from git reset --hard?
链接地址: http://www.djcxy.com/p/23506.html上一篇: 如何反向申请与冲突存储?