git rebase --abort后恢复 [英] Recover after git rebase --abort

查看:271
本文介绍了git rebase --abort后恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一天前,我在存储库中启动了git rebase,但从未完成.当我仍处于基准状态时,我忘记了并做了很多修改.今天,我不小心做了一个git rebase --abort 而没有将这些修改提交.现在看来我所有的修改都消失了.有什么办法可以恢复它们?

I started a git rebase in my repository a day ago and never finished it. I forgot about and did a lot of modifications while I was still in the rebase. Today I accidentally did a git rebase --abort without putting those modifications in a commit. Now it looks like all my modifications are gone. Is there any way to recover them?

我的git reflog看起来像这样:

57d731c HEAD@{0}: rebase: aborting
d2d3738 HEAD@{1}: rebase -i (start): checkout david
57d731c HEAD@{2}: commit: My commit message

推荐答案

仅当您已添加内容时,即使您没有提交,也只能恢复. 但是,如果您甚至没有将更改添加到登台中,那么除非使用IDE并且IDE具有更改的本地历史记录,否则您将无法恢复这些更改.

You can only recover if you have added the content even if you did not commit. But if you did not even added the changes to the staging are you cannot recover those changes unless you use IDE and the IDE has local history of your changes.

git一旦在舞台区域中就开始跟踪文件,而不是在未跟踪时开始跟踪文件.

git start to track file once they are in the stage area and not while they are untracked.

所有专业的IDE中都存在本地历史记录.

The local history exists in all the majors IDEs.

这篇关于git rebase --abort后恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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