last commit rollback code example
Example 1: undo most recent commit
$ git commit -m "some comment"
$ git reset HEAD~
<< edit files as necessary >>
$ git add ...
$ git commit -c ORIG_HEAD
Example 2: how to abandon changes and go last commit
#ignore all changes, and back to last commit
git add .
git stash