git revert with git reset
Common denominator: The submitted code will be returned to staging area
Different points:
git revert: Undo an action, use a new commit to mark the old commit invalidation, that is, cancel the operation. There will be one commit committed in git log, one revocation commit
Git reset: Undo a commit, roll head back, or delete a new commit. No new commit in Git log
Note: When you continue with the previous version of merge in the future, because git revert is a reverse commit "in and" before, this change will not recur when you merge Old branch later.
Git reset removes certain commits from one branch, so the rollback commit should be introduced again when you merge with the old branch.
In the usual code, get used to reset. Avoid committing the operation by mistake, or accidentally using git revert, you can revoke the commit with git reset.
git revert with git reset