git rebase revert code example Example 1: git undo rebase git reset --hard ORIG_HEAD Example 2: undo git rebase git reset --hard HEAD@{5}