Git · Middle · Question 11 of 75

How do you undo a merge commit that was already pushed to main?

Explanation

A merge has two parents, so revert needs -m to know which side is the mainline. Note that re-merging the same branch later won't bring the reverted changes back unless you revert the revert.

Further reading

Problem with a question

Git · Middle · question 11

Test yourself

Take the Git · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz