git undo last commit after pushed keep changes code example Example: git reset keep changes git reset HEAD^ --soft