# Sort out a conflicted copy (/use/conflicts)

See what happens when a file or a note changes in two places at once, and keep the version you want.



A file can change in two places at once, such as in two directories that follow one folder, or in your editor and from an agent. **What Marfa keeps depends on the kind of file.**

## A file such as a photo or a PDF [#a-file-such-as-a-photo-or-a-pdf]

**The later write wins,** and every directory gets it at its next sync. The earlier version stays in the item's history. To get it back, list the item's versions, copy the earlier version's `blob_ref`, and download its bytes:

```bash
marfa items versions 01a1f470-1f08-7006-8897-e8578ff0a615 --json
marfa blobs download sha256:728b6feebe65d1addec0e13fbda13e177b3ca2b16a928da1c359259e8dfd6369 --output beach-earlier.png
```

## A note [#a-note]

**Most edits merge:** a tag added in one place and a new body in the other both reach the note. When both change the note's body, even on different lines, or both change its `notes` property, the edit that reaches your instance first keeps the note, and **the other becomes a conflicted copy** beside it, in every directory that follows the folder:

```markdown title="Home/Packing list (2).md"
---
type: core.note
tags:
  - conflicted-copy
  - home
title: Packing list
derived-from:
  - "[[01a1f470-1ef0-742f-bbfd-9778bef2e18f]]"
marfa_id: 928a8aeb-c27b-71bb-8a07-e67863a57ec3
marfa_version: 1
---
Passport, sun hat, sandals.
```

The copy holds the second edit word for word, is tagged `conflicted-copy`, and names the original on its `derived-from` line. `marfa items list --tag conflicted-copy` finds every copy.

To keep the version you want:

1. Open both files, `Packing list.md` and `Packing list (2).md`.
2. Copy what you want from the copy into the original, and save it.
3. Delete the copy's file. It moves to the bin, where you can restore it.

**Edit the original, not the copy,** so the note's links, tags and history stay with it. An agent can do the same: ask it to find notes tagged `conflicted-copy` and merge each pair as you say.

## A save made as Marfa writes [#a-save-made-as-marfa-writes]

**Marfa never overwrites or removes a save it didn't read.** If your editor saves a file just as Marfa writes a change from your instance into it, or removes it, Marfa puts your save back at the path, and the next sync sends it. If another file took the path meanwhile, Marfa keeps your save beside it under the next free numbered name, such as `Packing list (2).md`, and `marfa folders status` flags it `kept`.

To make conflicts rare, keep a [watch](/use/keep-folders-syncing) running on every computer, so each edit reaches the others before the next one starts.
