The reflog is a feature that isn't that well publicised as it's a "what happened" command, rather than a "stuff to get done" command.
Well done for discovering the logs and for reporting back to the community. Thank you. On Thursday, September 3, 2020 at 8:13:45 AM UTC+1 victo...@gmail.com wrote: > > After a rather long rebase was succesfully completed (but not yet pushed > anywhere else) I went back to clean up some more. > > In the middle of it I did a `git rebase --edit-todo` and decided I would > like to abort the edit. > > I did what I also do when aborting a commit: removed everything, saved > and closed the editor, and since there were no changes continued with `git > rebase --continue` > > Unfortunately now 34 commits are gone. > > 1) Is the different behaviour between commit and edit-todo a bug or a > feature? > > (Since a few minutes I have a strong opinion about that.) > > 2) Is there a chance to get my changes back? I would prefer to be "lazy" > and dig through some git meta-data then to do the rebase again... > > (Didn't do anything yet on it since the "incident") > > > > Found a solution: > Without knowing where to look at first I grepped the `.git` directory for > one of the commit messages where I knew that I changed the wording. > grep pointed me to `.git/logs/HEAD`. This file is a list which looks like: > > <SHA> <SHA> <commiter> <time> <action> <commit-message> > > The SHAs look like to be FROM and TO. I choose the latest TO SHA where > <commit message> matched the latest commit I knew of. > So > git checkout <TO_SHA> > git checkout -b branch_recovered > saved my day (or at least a good amount of time). > > Best, > Victor > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/95356bc6-f21c-4ccc-9f24-dfd267822164n%40googlegroups.com.