GIT Pull删除了我的提交 [英] GIT Pull deleted my commit

查看:135
本文介绍了GIT Pull删除了我的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在git pull之后,我已经完成了git重置操作,以便在合并之前撤消与提交id的合并。但是,我的整个提交已经过去了,我也无法看到历史提交。但我有commit id,在git show命令中,我可以看到我的更改。



如何取回我的更改以及如何跟踪我所做的错误

如果你有提交散列,并且你还没有运行垃圾回收,那么你总是可以回到那个提交<$ c < $ c> git checkout< sha1> 。如果你想重新应用它在当前头上,你可以做 git cherry-pick


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

解决方案

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>

这篇关于GIT Pull删除了我的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆