Git reset vs. Git revert

Git reset vs. Git revert

This method would not have the disadvantage of git reset, it would point HEAD to newly created reverting commit and it is ok to directly push the changes to remote without using the -f option. It’s not a good idea to use git reset to rollback the commit B since we need to keep commit C as it is a good commit. From above explanation, we can find out that the biggest difference between git reset and git revert is that git reset will reset the state of the branch to a previous state by dropping all the changes post the desired commit while git revert will reset to a previous state by creating new reverting commits and keep the original commits.

Source: www.pingtech.xyz