---
title: "Reland a reverted merge without losing half of it | Proofline"
description: "If a merge was reverted on main, merging the same branch again brings in only the commits made after the first merge."
url: https://proofline.sh/learn/reland-after-revert/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# Reland a reverted merge without losing half of it

If a merge was reverted on main, merging the same branch again brings in only the commits made after the first merge. The person who reverts should tell the author which way to reland: revert the revert first, or rebuild the branch with new commits.

Deployment failures The Proofline team November 24, 2026 3 min read

## The missing files

The fixture merges `feat`, which adds `f` and `g`, with a merge commit. Someone reverts that merge with `git revert -m 1`. The author adds a test file `t` to `feat` and merges again. Git reports success:

```
$ git merge feat
$ ls
a
t
```

`f` and `g` are absent, and there was no conflict. The merge base of `main` and `feat` is the commit that added them, so Git sees them as already merged and then deliberately removed. Only `t` is new. Git's own [note on reverting a faulty merge](https://github.com/git/git/blob/master/Documentation/howto/revert-a-faulty-merge.adoc) describes this.

When the author edits `f` on the branch instead of adding a file, the second merge stops with `CONFLICT (modify/delete): f deleted in HEAD`. That conflict is the luckier case, because somebody looks.

## Choose the way back

| How the change first landed | Reland |
| --- | --- |
| Merge commit, and the same branch continues | `git revert REVERT_SHA`, then merge the branch |
| Merge commit, and the author prefers a clean series | `git rebase --no-ff BASE` on the branch, where `BASE` is its original branch point, then merge |
| Squash merge | Merge or squash the branch again, then check the result against the branch |

In the fixture, reverting the revert and then merging gave `a`, `f`, `g` and `t`. So did the rebase onto `BASE`, which gives every commit of the branch a new ID. Rebasing onto `main` with the same option replayed only the commit that added `t`, and `f` and `g` stayed missing. After a squash merge and a revert, merging the original branch gave `a`, `f` and `t`: a squash leaves no ancestry between the branch and `main`, so Git compared the branch with the older base. Run with Git 2.43. Do not generalize the squash result. If `main` edited the same lines since, you get a conflict instead.

## What the person reverting hands over

1.  The revert commit and the commit it reverted.
2.  Whether the original was a merge commit or a squash: `git cat-file -p SHA | grep -c ^parent` prints 2 for a merge.
3.  The observation that led to the revert, with time and release.
4.  What must be true before relanding, as a check someone can run.
5.  Which row of the table above applies.

Item 4 is the one that goes missing. "Reverted, caused errors" leaves the author to guess whether a new test would satisfy the person who reverted.

## Check the relanded tree

List the paths the feature changed, then compare the two finished trees. Keep the two lists separate so a filename containing spaces stays intact.

```
git diff --name-status --no-renames BASE feat
git diff --name-status --no-renames feat main
```

`BASE` is the commit the branch started from. In the second list, `D` beside a feature path means the file exists on `feat` and is missing from `main`. Explain each difference that affects a path in the first list. If the second list is empty, the two trees match. Run the test that covers the original failure before relanding.

## Worked example

This example is fictional. An on-call engineer reverts an export feature at 02:10 UTC and writes: "Merge commit. Reland by reverting this revert, then merging. Condition: export of an account with no orders returns 200; it returned 500 on release 418." The author adds the test, reverts the revert and merges. Their first attempt had skipped the second step, and the diff above listed two missing files before anyone approved it.

[Backports](/learn/backport-commits-already-picked/) have a related trap. [Handing over evidence](/learn/engineering-handoff-evidence/) covers the rest.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Tell the next engineer which fixes are already on the release branch](/learn/backport-commits-already-picked/)
    
    Deployment failures The Proofline team November 24, 2026 2 min read
    
-   ### [Ask another engineer to resolve half of a merge conflict](/learn/merge-conflict-handoff/)
    
    Code review The Proofline team November 24, 2026 3 min read
