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