git reset all commits but no last code example Example 1: git reset keep changes git reset HEAD^ --soft Example 2: git revert commit but keep changes git reset HEAD^