---
title: "06 Version History"
canonical_url: https://mdflow.cz/share/c/h0L7MvX5Cy5sST3qPnApqHOmrQ36JTVy169qJMtDMya9Kc30zm04cg9OuPSSPwvj/9c6737c5-cb49-4eb8-83c8-d9a72e36fa3c
md_url: https://mdflow.cz/share/c/h0L7MvX5Cy5sST3qPnApqHOmrQ36JTVy169qJMtDMya9Kc30zm04cg9OuPSSPwvj/9c6737c5-cb49-4eb8-83c8-d9a72e36fa3c.md
visibility: public
---

# Version History

Every saved change to a document's body automatically captures the previous version. You do not have to opt in, name a version, or remember to snapshot anything.

**Version history is a Pro feature.**

## What gets captured

Capture covers **every write path**:

- the in-app editor,
- the HTTP API (see [02 HTTP API](/doc/bdb63d7f-857f-42ef-b13f-aa4d139e7cf8)),
- the MCP server (see [03 MCP Servers](/doc/aad78a27-0654-4781-b4b7-6ced0b14dbfc)).

So history is recorded no matter how a document is updated — including changes made by an AI agent or a script while you were not watching. That is arguably when you want it most.

Only the **body** is versioned. Renaming a document or moving it between folders does not create a history entry.

## Browsing history

Open the version history for the document you are editing. Versions are listed **newest first**, each labelled by when it was current.

## Comparing versions

Select any previous version to see a **line-by-line markdown diff** against the current document. Because markdown is plain text, these diffs are precise and readable — you see exactly which lines changed, not a vague "this document was modified".

## Restoring

**Set as latest version** restores a previous version as the new current text.

The restore is **non-destructive**: your current text is not thrown away, it is preserved as a new history entry. So restoring is itself undoable. If you restore the wrong version, restore again.

## Encrypted documents

Encrypted documents are versioned too, with one difference: snapshots are stored as **ciphertext**, exactly like the document itself. The server never holds a readable copy of any version. See [01 Document Encryption](/doc/b230e154-6c58-4bfd-8a7a-c70bc7bebcd7).

The consequence is practical: **viewing a diff or restoring requires the document to be unlocked in your browser**, because the decryption happens on your device. Lock the document and history is opaque to everyone, including MDflow.

## Retention

History is bounded per document. Whichever limit is reached first applies:

- **30 days**, or
- **the last 300 versions**.

Two adjustments:

- Documents **larger than 100 KiB** keep only the **last 10 versions**, since snapshots of large documents are expensive.
- **Rapid successive saves within a minute are collapsed** into a single capture. Autosave therefore does not shred your history into hundreds of one-word deltas.

## Privacy

Version history is **private to the document owner**. It is not exposed through the HTTP API or the MCP server.

This is worth stating plainly: an AI agent with a Personal Access Token can read, write and delete your documents, but it **cannot read their history**. If an agent overwrites something it should not have, the record of what was there is yours alone — and it is exactly how you get the old text back.

## What happens on downgrade

Free accounts accrue **no history at all**, and existing history is **removed when a workspace returns to the Free plan**. See [04 Free and Pro Plans](/doc/b55abc0c-ac5d-44cb-b5a5-22b3cc04a69f).

Your documents are untouched by a downgrade. Only the recorded history goes. If you are cancelling Pro and there is a past version you care about, restore it — or copy the text out — before the subscription ends.
