git reset undo previous commit but keep changes code example Example: undo last commit but keep changes git reset @~