git undo last local commit keep changes code example
Example 1: git reset keep changes
git reset HEAD^ --soft
Example 2: undo last commit
git reset --soft HEAD~1
Example 3: git revert commit but keep changes
git reset HEAD^
Example 4: git undo last commit
git reset --soft HEAD~1