merge commit revert 🌿 Git

error: commit x is a merge but no -m option was given.

git revert or cherry-pick on a merge commit needs to know which parent is the mainline.

Seen on: Git

Meaning

Merge commits have two parents; -m 1 usually means "keep the target branch side".

Common causes

  • Reverting/cherry-picking a merge commit without -m
  • Undoing a merged pull request from the command line

⚡ Quick fix

  1. git revert -m 1 <merge-commit>
  2. Cherry-pick individual commits instead of the merge

Detailed fix by platform

Git

  1. git revert -m 1 a1b2c3d

How to diagnose

  1. Parents — git show --format=%P <commit>
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.