Complete the command to abort a bad rebase and return to the previous state.
git rebase [1]Using git rebase --abort stops the rebase and resets your branch to the state before the rebase started.
Complete the command to view the reflog, which helps find previous commit states after a bad rebase.
git [1]git reflog shows a history of where your HEAD and branches have been, useful to recover lost commits.
Fix the command to reset your branch to a previous commit found in reflog after a bad rebase.
git reset --hard [1]HEAD@{3} refers to the state of HEAD three moves ago in the reflog, useful to recover before the bad rebase.
Fill both blanks to create a new branch from a previous commit to save work before fixing a bad rebase.
git checkout -b [1] [2]
Create a new branch named recovery-branch from the previous HEAD state HEAD@{1} to preserve work before fixing the rebase.
Fill all three blanks to reset your current branch to a previous commit and force push to update the remote after a bad rebase.
git reset --hard [1] && git push [2] [3]
Reset to the previous HEAD state HEAD@{2}, then force push to origin with --force to update the remote branch after fixing the bad rebase.