QuestionQ143

Software Development and Design

Question Image

Refer to the exhibit. Which command resolves the merge conflict while removing the prior commit from the commit history?

  • A
  • B
  • C
  • D
Explanation

git reset --hard HEAD~1 moves the current branch from HEAD to its parent commit, removing the latest commit from the branch history. The --hard option also resets the index and working tree to that commit, clearing the unresolved merge state. git revert instead preserves history by adding a new inverse commit.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!