Reputation: 63546
I have four linear commits on one branch that I update using git rebase --interactive
. They are:
small fixes to irrelevant files
FeedbackViewController tests
live feedback tests
poke build bot
I managed to lose the commit titled "FeedbackViewController". Now I have only:
small fixes to irrelevant files
live feedback tests
poke build bot
where did I lose this commit, and how can I get it back at the locating of the third-oldest commit?
Here's the output of git reflog --date=relative
:
b2681e4 HEAD@{21 seconds ago}: rebase -i (finish): returning to refs/heads/end
b2681e4 HEAD@{24 seconds ago}: checkout: moving from end to b2681e4
b2681e4 HEAD@{31 minutes ago}: rebase finished: returning to refs/heads/end
b2681e4 HEAD@{31 minutes ago}: rebase: small fixes to irrelevant files
6f80728 HEAD@{31 minutes ago}: rebase: live feedback tests
56b5212 HEAD@{31 minutes ago}: rebase: poke build bot
10bc997 HEAD@{33 minutes ago}: checkout: moving from end to 10bc997faa7d5cad52c5b3f1dc25816c13220187^0
422f15a HEAD@{25 hours ago}: rebase finished: returning to refs/heads/end
422f15a HEAD@{25 hours ago}: rebase: small fixes to irrelevant files
79d7596 HEAD@{25 hours ago}: pull --rebase: live feedback tests
52072ec HEAD@{25 hours ago}: pull --rebase: poke build bot
62c8870 HEAD@{25 hours ago}: checkout: moving from end to 62c887017d969d98ec5874698c82f94523fe5ac6^0
ca2f134 HEAD@{25 hours ago}: rebase finished: returning to refs/heads/end
ca2f134 HEAD@{25 hours ago}: rebase: small fixes to irrelevant files
8bce052 HEAD@{25 hours ago}: rebase: FeedbackViewController tests
d581615 HEAD@{25 hours ago}: rebase: live feedback tests
c9adb82 HEAD@{25 hours ago}: rebase: poke build bot
e556052 HEAD@{26 hours ago}: checkout: moving from end to e556052f0db5c674e4145e56001df08cb809f936^0
399758d HEAD@{26 hours ago}: rebase finished: returning to refs/heads/end
399758d HEAD@{26 hours ago}: rebase: small fixes to irrelevant files
3f6385d HEAD@{26 hours ago}: rebase: FeedbackViewController tests
ba01791 HEAD@{26 hours ago}: rebase: live feedback tests
e9159db HEAD@{26 hours ago}: rebase: poke build bot
ADDED QUESTION:
I'm especially curious about these lines:
422f15a HEAD@{25 hours ago}: rebase finished: returning to refs/heads/end
422f15a HEAD@{25 hours ago}: rebase: small fixes to irrelevant files
79d7596 HEAD@{25 hours ago}: pull --rebase: live feedback tests
52072ec HEAD@{25 hours ago}: pull --rebase: poke build bot
How did I manage to pull --rebase
and rebase
in the same line? Usually when I do a pull --rebase
, it updates all four of them at once, as in:
18cb678 HEAD@{2 days ago}: rebase finished: returning to refs/heads/end
18cb678 HEAD@{2 days ago}: pull --rebase: small fixes to irrelevant files
744ce78 HEAD@{2 days ago}: pull --rebase: FBFeedbackViewController tests
7fd9af4 HEAD@{2 days ago}: pull --rebase: live feedback tests
1b7aa06 HEAD@{2 days ago}: pull --rebase: update feedback when MQTT message is received
SOLUTION:
By using git reflog branch-name
rather than git reflog
, I can see one entry for the entire rebase operation, so I can go back to that state in my project.
The output of git reflog branch-name --date=relative
looks like this:
b2681e4 end@{71 minutes ago}: rebase finished: refs/heads/end onto 10bc997faa7d5cad52c5b3f1dc25816c13220187
422f15a end@{26 hours ago}: rebase finished: refs/heads/end onto 62c887017d969d98ec5874698c82f94523fe5ac6
ca2f134 end@{26 hours ago}: rebase finished: refs/heads/end onto e556052f0db5c674e4145e56001df08cb809f936
399758d end@{26 hours ago}: rebase finished: refs/heads/end onto 9276926e7fe7417db622e42da44e54eac4db1f85
a8ca29d end@{2 days ago}: rebase -i (finish): refs/heads/end onto bfe8d25
18cb678 end@{2 days ago}: rebase finished: refs/heads/end onto 967a525790be38e06b42ff314f47821ec867403f
21c2da4 end@{2 days ago}: rebase finished: refs/heads/end onto f94d81aa5c3ecf6445db06692dee4f6c40d96c0b
Upvotes: 2
Views: 513
Reputation: 185671
Either you accidentally deleted it from the interactive rebase recipe list, or it ended up being identical to a commit that you're rebasing on top of and therefore was skipped.
Upvotes: 2