问题
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:
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>
来源:https://stackoverflow.com/questions/6201802/git-pull-deleted-my-commit