Introduction
Sometimes when you try to clean up your commit history using rebase, things can go wrong and your code may break or commits get lost. Recovering from a bad rebase helps you go back to a safe state without losing your work.
When you accidentally delete commits during an interactive rebase
When a rebase causes conflicts that you cannot resolve easily
When your branch history looks wrong after rebasing
When you want to undo a rebase and return to the previous branch state
When you realize the rebase introduced bugs and want to start over