revert commit adn keep changes code example Example: undo git commit and keep changes git reset HEAD^ git reset