What is the difference between a git reset and a git revert.

Devops Devops in Devops . 2 years ago

  0   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
  • git revert is used to record some new commits to reverse the effect of some earlier commits/snapshot of a project.
  • Instead of REMOVING the commit from the project history, it figures out how to undo the changes introduced by the commit & appends a new commit with the resulting content in the current branch.

  • Usage: git revert <commit_id>
  • USE: To undo an ENTIRE commit from your project history; removing a bug introduced by a commit.

Reset VS Revert

  • git “reset”: resets the project to a previous snapshot ERASING the changes.
  • git “revert” does not change the project history unlike git “reset”
  • Git “revert” undoes the commit id changes and applies the undo work as a new commit id object.

Posted on 31 May 2022, this text provides information on Devops related to Devops in Devops. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.