How can you revert a pushed commit in Git without losing history?

  • git reset
  • git revert
  • git rollback
  • git backout
To revert a pushed commit without losing history, use git revert. This command creates a new commit that undoes the changes introduced by the previous commit, preserving the commit history and avoiding force pushes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *