Function of revert:
- revert a commit to let those changes not happen
- this is a way useful for a part of a team to just cancel his/her commits without affecting other pulls
Representative Methods:
git revert <commit-serial-number>
this revert the commit with the corresponding serial number.
OR
git revert HEAD~1
this revert a commit before HEAD.
commit-serial-number:
- we can get the commit serial number with:
git log

the long string after “commit” is the commit serial number we need.
Rules of revert:
- cannot revert HEAD
- if a file was changed for several times, you can only start reverting from the latest one
