After a failed merge attempt, a developer needs to undo the merge to maintain project stability while resolving conflicts. What Git feature or command should they use?
- git reset --hard HEAD
- git revert HEAD
- git checkout -b new-branch
- git clean -df
The git reset --hard HEAD command is used to undo the last commit and return the repository to the state of the last successful merge. This allows the developer to start fresh and reattempt the merge while resolving conflicts. Other options like git revert and git clean have different purposes and do not address the need to undo the merge.
Loading...
Related Quiz
- How does a lightweight tag in Git differ from an annotated tag?
- Merging branches in Git typically involves the _______ branch into the current branch.
- How does Git's data model handle changes across different branches?
- Describe the role of 'feature branches' in Git's branching model.
- In the context of enterprise, what is a key benefit of implementing Git LFS (Large File Storage)?