GIT Pull删除了我的提交

编程入门 行业动态 更新时间:2024-10-17 01:18:05
本文介绍了GIT Pull删除了我的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

如果你有提交散列,并且你还没有运行垃圾回收,那么你总是可以回到那个提交<$ 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删除了我的提交

本文发布于:2023-11-01 01:54:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547905.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:GIT   Pull

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!