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.
Loading...
Related Quiz
- A developer needs to integrate their feature branch with the latest updates from the main branch, but wants to maintain a clean history. Should they use merge or rebase, and why?
- Using SSH ________ is a recommended method for secure authentication in Git.
- To see a graphical representation of the commit history, you can use git log --_______.
- Your team is reviewing a complex set of changes. How can you use Git to navigate through each change individually to discuss them?
- Which operation in Git temporarily stores changes that you don't want to commit immediately?