Run alembic heads and count the results.

Run alembic history and find where the branches split from a common ancestor.

Decide whether both branches contain migrations that have actually run against this database.

Create a merge revision with alembic merge using the two head ids, and open the generated file to confirm its down_revision lists both heads.

If one branch was never applied anywhere, the alternative is editing that branch's first revision so its down_revision points at the other head, then re-checking heads.

Run the downgrade to your target revision.