Recover from git reset --hard?

2018-12-31 10:29发布

Is there any way to recover uncommitted changes to the working directory from a git reset --hard HEAD?

标签: git
19条回答
妖精总统
2楼-- · 2018-12-31 11:11

Reference answer from this SO,

After running git reflog show say you want to go to commit 9300f9d

after running git reset 9300f9d

you can do git status, and then you may need to checkout your file(s) to restore your changes

git checkout -- filepath/name

查看更多
登录 后发表回答