GIT Pull deleted my commit

2019-04-11 10:04发布

After git pull I have done git reset hard to undo the merge with commit id before merge.Somehow my entire commit is gone and I cant the see the commit in history also. But I have the commit id , on git show command I can see my changes.

How can I get back my changes and how to track what mistake I have done

1条回答
Fickle 薄情
2楼-- · 2019-04-11 10:53

if you have the commit hash, and you have not run garbage collection, you can always go back to that commit with git checkout <sha1>. if you want to re-apply it on top of your current head, you could do git cherry-pick <sha1>

查看更多
登录 后发表回答