且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

恢复交互式git rebase

更新时间:2023-11-03 19:22:04

如果您刚刚完成了rebase,您可以尝试

If you have just done the rebase, you can try as mentioned here:

git reset --hard ORIG_HEAD

as JakubNarębski 详细信息


ORIG_HEAD 是之前的状态 HEAD ,由可能具有危险行为的命令设置,以便于恢复它们。

现在,Git ha s引用日志: HEAD @ {1} 大致相当于 ORIG_HEAD HEAD @ {1 } 始终是 HEAD的最后一个值, ORIG_HEAD 是,因为

ORIG_HEAD is previous state of HEAD, set by commands that have possibly dangerous behavior, to be easy to revert them.
It is less useful now that Git has reflog: HEAD@{1} is roughly equivalent to ORIG_HEAD (HEAD@{1} is always last value of HEAD, ORIG_HEAD is last value of HEAD before dangerous operation).

em> rebase, reflog 仍然可以帮助

If you have executed some operations since the rebase, the reflog can still help.