git undo previous rebase on local branch code example Example: undo git rebase git reset --hard HEAD@{5}