GIT Pull deleted my commit

荒凉一梦 提交于 2019-12-06 04:54:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!