revert last git add code example
Example 1: revert last commit
$ git reset --soft HEAD~1
Example 2: revert last merge git
git revert -m 1 commit_hash
Example 3: undo git add but keep changes
git reset -- FILE_NAME
$ git reset --soft HEAD~1
git revert -m 1 commit_hash
git reset -- FILE_NAME