> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trytalkvalue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# talkvalue path person merge-undo

> Reverse a person merge by mergeOperationId, restoring the source record. Requires --confirm.

Reverse a prior [`person merge`](/cli/commands/path/person/merge). `talkvalue path person merge-undo` restores the retired source record, splits the merged emails, phones, channels, events, and activity history back to their original owners, and returns the target to its pre-merge state. Use this when a merge collapsed the wrong pair and you catch it inside the retention window.

## Synopsis

```bash theme={null}
talkvalue path person merge-undo <mergeOperationId> --confirm
```

## Arguments

| Argument             | Type    | Description                                                                                                                                                                      |
| -------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<mergeOperationId>` | integer | The merge operation to reverse. Find it in the target's [`person get`](/cli/commands/path/person/get) response under `mergeOperations[].id`, or in the dashboard's activity log. |

## Options

| Flag        | Type | Description                                                       |
| ----------- | ---- | ----------------------------------------------------------------- |
| `--confirm` | flag | Required. The CLI exits with a usage error if you omit this flag. |

## Examples

### 1. Undo a recent merge

```bash theme={null}
talkvalue path person merge-undo 503 --confirm
```

Reverses merge `503`. The output is `{ "undone": true, "mergeOperationId": 503 }`. Re-read the target with `person get` to confirm the source is no longer in `mergeOperations`.

### 2. Find the operation ID from the target

```bash theme={null}
talkvalue path person get 142 --json \
  | jq -r '.data.mergeOperations[0].id' \
  | xargs -I {} talkvalue path person merge-undo {} --confirm
```

Pulls the most recent merge on person `142` and reverses it in one pipeline. Handy when you know which target person was affected but not the specific operation ID.

### 3. Guard against a stale operation

```bash theme={null}
op_id=503
if talkvalue path person merge-undo "$op_id" --confirm 2>/dev/null; then
  echo "Reversed merge $op_id"
else
  echo "Cannot undo $op_id (past retention window or already undone)" >&2
fi
```

The CLI exits non-zero on `404` (operation not found) or `409` (already undone, or past the retention window). See [Exit codes](/cli/exit-codes) for the full mapping.

## Response

```jsonc theme={null}
{
  "data": {
    "undone": true,
    "mergeOperationId": 503
  }
}
```

TalkValue replays the prior split. After the call, the source person ID resolves again via `person get`, and the target's `mergeOperations` list no longer contains the reversed entry.

## See also

* [`person merge`](/cli/commands/path/person/merge). The forward operation this command reverses.
* [`person get`](/cli/commands/path/person/get). Read `mergeOperations[].id` from the target's detail record.
* [`person activity`](/cli/commands/path/person/activity). `UNMERGED` entries record the reversal.
* [People](/path/manage/people). The dashboard surface for the same operation.
