rebase loacl branch to discard the commit code example Example: undo git rebase git reset --hard HEAD@{5}