undo last ubpushed commit code example Example: git revert last commit unpushed git reset --soft HEAD~1