我有一个像这样的存储库日志......
<randomSha> 5
<randomSha> 4
<randomSha> 3
<randomSha> 2
<randomSha> 1
我想修改&#39; 3&#39;所以...
git rebase --interactive <shaOf1>
git commit --all --amend --no-edit
git rebase --continue
我重复了最后两步,直到我得到第5项。
这一切都奏效但是当我做了git log --oneline
我现在只有这些
<randomSha> 3
<randomSha> 2
<randomSha> 1
4和5哪里去了?
更新:有人建议我查看给我这个的reflog ......
fa755b2 HEAD@{0}: rebase -i (finish): returning to refs/heads/master
fa755b2 HEAD@{1}: commit (amend): 3
55ff2f2 HEAD@{2}: cherry-pick: fast-forward
89a44a2 HEAD@{3}: rebase -i (start): checkout eea7ec2^
5149153 HEAD@{4}: rebase -i (finish): returning to refs/heads/master
5149153 HEAD@{5}: rebase -i (start): checkout 5149153^
5149153 HEAD@{6}: commit: 5
8eab00c HEAD@{7}: commit: 4
55ff2f2 HEAD@{8}: commit: 3
89a44a2 HEAD@{9}: commit: 2
eea7ec2 HEAD@{10}: commit: 1
b5ae9d7 HEAD@{11}: commit (initial): initial
有谁知道4和5去了哪里?我在第一次结账时有点迷失......