how to delete a commit without deleting my changes code example Example: remove the last commit git without losing changes git reset HEAD~1 --soft