What is the difference between git reset and git revert?
- git reset removes commits
- git reset undoes changes in the working directory
- git revert removes commits
- git revert undoes changes in the working directory
The correct option is git revert. Unlike git reset, which removes commits from the branch history, git revert creates a new commit that undoes the changes introduced by a specific commit. This ensures a safer and non-destructive way to undo changes. git reset, on the other hand, can be used to move the branch pointer and potentially discard commits.
Loading...
Related Quiz
- How can GPG (GNU Privacy Guard) be used in the context of Git?
- The git _______ command creates a new commit that undoes all of the changes made in a specified commit.
- Which command is used to undo a commit that has not been pushed to the remote repository?
- What strategies can be employed in Git to manage a large number of contributors in an open source project?
- In an open source project, a critical bug is discovered in a release. How should the maintainers use Git to address this issue promptly while maintaining the integrity of the project?