git undo a commit and keep changes code example Example: git reset keep changes git reset HEAD^ --soft