What does git revert do and how does it differ from git reset?

Git Medium

Git — Medium

What does git revert do and how does it differ from git reset?

Key points

  • Git revert preserves commit history by creating a new commit.
  • Git reset alters the branch pointer, potentially losing commits.
  • The two commands serve distinct purposes in managing commit history.
  • Git revert is generally used for public commits, while git reset is used for local changes.

Ready to go further?

Related questions