git undo commit reset soft code example
Example 1: undo local commit
$ git reset --soft HEAD~1
Example 2: git soft reset 1 commit
# reset one commit
git reset --soft HEAD~1
# reset to s specefic commit point
git reset --soft <COMMIT ID>
Example 3: undo last commit
$ git reset --hard HEAD~1