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

# Editing and file history

> Edit text files in place, save with Ctrl+S, and keep changes safe: three recent versions, named checkpoints, compare, restore and conflicted copies.

Fix a figure in a report yourself, see exactly what changed since yesterday, and roll back in two clicks, without ever losing someone else's work.

<Frame caption="The editor on a report in Workspace files: one figure changed, the orange dot says it isn't saved yet, and More ways to save is open.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/01-editor.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=cfc85c472ca854113180a3a9ec87cc62" alt="The editor showing Q3 summary.md with an unsaved-changes dot, Code and Preview, the Save button and its menu offering Save with note… and a disabled Create checkpoint… that says to save first" width="1360" height="1022" data-path="images/cowork/files/editing-and-history/01-editor.webp" />
</Frame>

Everything on this page is for [Workspace files](/cowork/files/workspace-files). A coworker's own files and a task's files keep no change history.

## Edit a file

Open a text file in the editor from **Edit** in its menu, in Quick Look or in its details, or double-click it in the list. Plain text, Markdown, CSV, web pages, data files and code all open there. Markdown, CSV, web pages and data files also have a **Preview** beside **Code**. Text files up to 1 MB are editable; a bigger one opens to read:

> View only: files over 1 MB open read-only here.

**Save** (Ctrl+S, Cmd+S on a Mac) saves your change as a new version. The orange dot beside the name means there's something unsaved, and closing the editor with unsaved text asks first.

**Save with note…** (Ctrl+Shift+S) does the same and adds a line to the version's history, so the next person knows why it changed:

<Frame caption="Save with note: a line that stays with this version.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/02-save-with-note.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=1f46e029a851eb3579ba51fab4e2e6e0" width="496" alt="The Save with note dialog with the note Updated the Q3 totals typed in" data-path="images/cowork/files/editing-and-history/02-save-with-note.webp" />
</Frame>

> Say what changed. The note stays with this version and shows in its history; later saves while the editor stays open join this version and keep it.

### If someone saved while you were editing

A notice tells you as soon as it happens, and your unsaved text stays put:

> Changed by Maya Chen. Your unsaved edits are kept until you choose.

When you save, you choose what to keep:

<Frame caption="Maya saved first. Nothing is lost whichever you choose; Save mine as a copy keeps both.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/09-someone-saved.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=5f28ec41053f4452c3fb58c9c3dc75fc" alt="The dialog This file changed while you were editing, offering Compare them first, Save mine as a copy, Reload theirs and Overwrite, over the editor and its Changed by Maya Chen notice" width="1360" height="1282" data-path="images/cowork/files/editing-and-history/09-someone-saved.webp" />
</Frame>

| Choice | What happens |
| - | - |
| **Compare them first** | See their version next to yours, then choose. |
| **Save mine as a copy** | Theirs stays as it is; yours is saved beside it, as "Q3 summary (my edits).md". |
| **Reload theirs** | Opens the newer version. Your unsaved edits are dropped. |
| **Overwrite** | Replaces their changes with yours. |

## Versions

Every save is a version. A file keeps its **last three**, the current one included, and the list says so:

> A file keeps its last 3 versions.

What counts as one version:

* **An editing session.** Your saves while the editor stays open join one version, as long as each comes within 10 minutes of the last.
* **A coworker's task, or a workflow run.** Its saves to the same file within 10 minutes join one version, so a coworker rewriting a report thirty times leaves one version, not thirty.
* **Nothing new.** Saving exactly what's already there makes no version.

**A coworker's or a workflow's save never pushes out a version a person wrote.** When a file already has three, an automation's save drops only versions automations wrote, so however often a coworker or a workflow saves, your edit stays in the file's history. A version that's replaced is kept for up to 30 days.

<Frame caption="Details for a file: its information, its versions with a checkpoint on top, and who changed it.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/03-details.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=65dd55e71d5a739aff5be116cd475061" width="362" alt="The Details pane for Q3 summary.md: Information, a Checkpoints group with Sent to the client, three recent versions by You and Nora with Open the task links and the note Updated the Q3 totals, and the Activity list" data-path="images/cowork/files/editing-and-history/03-details.webp" />
</Frame>

**Versions…**, in a file's menu or its details, opens them all side by side with a preview of each:

<Frame caption="The Versions dialog: checkpoints first, then the recent versions, here at three.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/04-versions.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=0ed76b917f6de9ea385f828cbdbd0714" alt="The Versions dialog of Q3 summary.md, with the checkpoint Sent to the client, three recent versions, the note Older versions aren't kept (3 per file), and the current version open" width="1600" height="1202" data-path="images/cowork/files/editing-and-history/04-versions.webp" />
</Frame>

## Compare two versions

Choose **Compare** to put two versions side by side, any two you like. Changed lines are tinted and the changed characters stand out. Text files are compared line by line, up to 1 MB per side; images side by side. Anything else, a database for instance, you download to compare.

<Frame caption="Nora's Wednesday version against the current one: two figures changed.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/06-compare.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=8ccce32cb863b9b6fa5c7616538a3230" alt="Compare in the Versions dialog: Oct 7, 2:48 PM by Nora on the left and the current version by You on the right, with the EMEA row and the total line highlighted" width="1396" height="1060" data-path="images/cowork/files/editing-and-history/06-compare.webp" />
</Frame>

## Restore an older version

Select a version and choose **Restore**. Its content becomes the newest version, so nothing is rewritten, and the message that confirms it offers **Undo**. When the file already has three versions, the dialog says which one will no longer be kept before you go ahead:

<Frame caption="Restoring at three versions: the bar names the version that goes.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/07-restore.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=1591cfb37e5bc8edc28942bc3281893b" alt="The Versions dialog with an orange bar: restoring the version from Oct 7 adds it as the newest version, so the version from Oct 6 by Nora will no longer be kept, with Cancel and Restore anyway" width="1396" height="740" data-path="images/cowork/files/editing-and-history/07-restore.webp" />
</Frame>

A restore is never refused for lack of space.

## Keep a version for good: checkpoints

A checkpoint is a version with a name, kept until someone removes it. Checkpoints sit outside the three recent versions, so no amount of saving pushes them out.

* **Create checkpoint…** names the file as it is now; **Name this version…** names an older one.
* A file keeps up to **three** checkpoints. At three, you're asked which one to replace.
* **Rename checkpoint…** and **Remove checkpoint…** are on the checkpoint itself.
* An older version kept as a checkpoint counts toward your storage.

<Frame caption="Create checkpoint: a name for the file as it is now.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/05-create-checkpoint.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=0d57e21edae375a148146a9c79d64892" width="496" alt="The Create checkpoint dialog explaining that a checkpoint keeps the file until someone removes it, with the name Sent to the client" data-path="images/cowork/files/editing-and-history/05-create-checkpoint.webp" />
</Frame>

Coworkers can make checkpoints too, before a risky or large edit or when you ask, and bring a file back to one. A coworker on **Can view** can only list them. Workflows and the AI tools you connect don't make checkpoints.

<Tip>
  **Make a checkpoint before you let a coworker or a workflow rework an important file.** If you don't like the result, restore the checkpoint and you're back where you started.
</Tip>

## Delete a version

People can delete a single version for good, any but the current one. Choose **Delete this version…** on it. For a checkpoint, the question names it first:

<Frame caption="Deleting a checkpoint's version deletes the checkpoint too.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/08-delete-checkpoint.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=570687dea92d699a7285339b7e9d025b" width="496" alt="The Delete this version? dialog naming the checkpoint Sent to the client, with Keep it and Delete checkpoint" data-path="images/cowork/files/editing-and-history/08-delete-checkpoint.webp" />
</Frame>

## Who changed what

A file's **Activity**, in its details, lists each change newest first: who made it (you, a teammate, a coworker, the Concierge or a workflow) and what they did, such as Created, Edited, Renamed, Moved to the Trash, Restored from the Trash or Made the checkpoint. A coworker's change links to **Open the task** when it's your task; a workflow's links to **Open the run**; the Concierge's says **In your Concierge chat**.

## Conflicted copies

When a coworker's save, or a workflow's **Execute Code** step, crosses someone else's change to the same file, nothing is overwritten. The second change is saved beside the file as **name (conflicted copy).ext**, then **(conflicted copy 2)**, and so on. Its details say so:

<Frame caption="A conflicted copy beside its original, and what to do about it.">
  <img src="https://mintcdn.com/glorium/hNHtPvQE-U6ALeRT/images/cowork/files/editing-and-history/10-conflicted-copy.webp?fit=max&auto=format&n=hNHtPvQE-U6ALeRT&q=85&s=96ce2dd051ef5a5d6dade795362aa8a3" alt="The Files list with Q3 summary (conflicted copy).md selected beside Q3 summary.md, and in Details the notice A conflicted copy: saved beside Q3 summary.md when two changes to it crossed, with Compare with original and Keep this one" width="1280" height="1178" data-path="images/cowork/files/editing-and-history/10-conflicted-copy.webp" />
</Frame>

* **Compare with original** opens the two side by side.
* **Keep this one** makes the copy's content the original's new version and moves the copy to the Trash.
* To keep the original, move the copy to the Trash.

A workflow's **Workspace Files** step never makes a conflicted copy. Writing to a file that already exists adds a new version by default, so the one before stays in the history.

## Good to know

<Warning>
  Deleting a version, or a checkpoint's version, can't be undone. To stop keeping a checkpoint but keep its version for now, choose **Remove checkpoint…** instead.
</Warning>

<Note>
  Restoring, comparing and checkpoints work on files in Workspace files. A coworker's own files and a task's files keep no change history.
</Note>

## Common questions

<AccordionGroup>
  <Accordion title="Why only three versions?" icon="layer-group">
    Three recent versions cover most "undo that" moments without filling your storage. For anything you must keep, make a checkpoint: it stays until someone removes it.
  </Accordion>

  <Accordion title="Does every Ctrl+S make a new version?" icon="floppy-disk">
    No. While the editor stays open, your saves join one version, as long as each comes within 10 minutes of the last. Close it and come back, or wait longer than that, and your next save starts a new one.
  </Accordion>

  <Accordion title="Can a coworker undo my edit?" icon="user-shield">
    A coworker can save a new version over yours, or restore a checkpoint, but it never pushes out a version you wrote. Yours stays in the file's history to restore, for up to 30 days after it's replaced, or for good as a checkpoint.
  </Accordion>

  <Accordion title="What is a conflicted copy?" icon="code-fork">
    A coworker's or a code step's change that crossed someone else's, saved beside the file so neither is lost. Compare it with the original, then keep one.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Sharing and access" icon="user-lock" href="/cowork/files/sharing-and-access">
    Who may change which files.
  </Card>

  <Card title="The Files page" icon="folder-open" href="/cowork/files/files-page">
    Browse, upload and organise.
  </Card>

  <Card title="Workspace files in workflows" icon="diagram-project" href="/cowork/files/in-workflows">
    Versions written by your workflows.
  </Card>

  <Card title="Seeing what changed" icon="code-compare" href="/cowork/files/changes">
    What a coworker edited in a task.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.