how to clear git commits code example Example: git revert last commit unpushed git reset --soft HEAD~1