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