Gitflow
🚪Bail Out of a Bad MergeEasy+300 XP
Workshop
Scenario reference

Bail Out of a Bad Merge: the situation, step by step

The situation

You started a merge, conflicts exploded across 30 files, and you realize you merged the wrong branch entirely.

`--abort` returns the repo to pre-merge state. No commits made, no shame.

Easy · 3 steps · +300 XP

What you will practice

This scenario walks through 3 steps, in order:

  1. 01Trigger the bad merge
  2. 02Abort the merge
  3. 03Verify clean state
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. Trigger the bad merge
    git merge feature-bad
  2. 2. Abort the merge
    git merge --abort
  3. 3. Verify clean state
    git status

Key takeaway

merge/rebase/cherry-pick all have --abort. Use them.