Re:Write yourself a Git (2018)
by palebluedot on Thursday March 14, 2019 @12:04PM
(#19390500)
Almost always, you can recover a bad rebase via git reflog.
[ Parent
| on HN ]
That's true, but it's an obscure feature, not a convenient "undo" button; to the average insecure git user you might as well tell them that their work has been eaten by a dragon and they can recruit another dragon to get it back.
Reflog may not be known by the average git user, but I think it is pretty convenient - just call `git reflog`, copy the hash before the rebase, and checkout/reset to that hash. Doesn't get much easier than that.