how to undo last commit but keep changes code example Example: git revert commit but keep changes git reset HEAD^