As far as I know, they do completely different things.
git revert
, designed to return the effects of a previous commit. For instance,
A <- B <- C ^ HEAD
If I found the B that I committed earlier, this is wrong, and I want to "undo" change it, git-revert
-ing B will result in:
A <- B <- C <- B' ^ HEAD
for which B'
changes the change made in B.
git reset
more straight forward, it just sets HEAD for a specific commit,
A <- B <- C ^ HEAD
git-reset
-ting to B will give you
A <- B <- C ^ HEAD
source share