DEV Community

Discussion on: ⛔ Squash commits considered harmful ⛔

Collapse
 
wesen profile image
Manuel Odendahl

you can do exactly the same for a merge commit by using git revert -m1. The squash merge commit and the merge commit both point to the same tree hash, they only differ wrt the parent commits. With a squash merge, you only have 1, so git revert knows "ok well you just want to revert to the parent". With the merge commit, you have 2, so you have to tell it "please use the left parent (aka, the parent on the main branch) to revert to". easy peasy!