Why put version history in a viewer?

Git is excellent, but it was not designed for "I edited a note". To recover one deleted paragraph you first need git init, git add, git commit — heavy lifting for most Markdown readers. Cloud-drive history is usually tied to a sync client, and can break when you go offline, move a folder or switch tools.

The actual need is modest: is that paragraph still there? Was yesterday's version better? Show me last week's next to today's. Long-time users may remember that mdpeek's earlier version history required a separate external tool. From 2.0 the storage, timeline, comparison and restore chain all live inside mdpeek.exe — right-click → "Version history".

It is not a Git replacement: no branches, no merges, no remotes. It is closer to a time machine for a single file — you write as usual, and there is a road back when you need one.

Where it lives: right-click → "Version history"

Right-click anywhere on the reading page and choose "Version history" to open the timeline. Each row carries four kinds of information:

  • Time: time of day for today's entries, a date for older ones;
  • Source: this was a save, an external change, or the automatic copy taken before a restore;
  • ± lines: how many lines were added and removed compared with the previous version;
  • Name: a label you gave it, such as "before sending to the client" or "before AI rewrite".

From each row you can view (a plain-text drawer showing the Markdown source), name, hide or restore. Hiding only dims the row and tucks it out of sight — the content is kept, and hidden versions are still selectable for comparison.

When snapshots happen

You do not have to remember to press "save a version". mdpeek records the key moments of normal writing for you:

MomentWhat happens
SaveAutosave from F2 in-place editing and F3 split-screen editing, plus manual Ctrl+S
Entering / leaving edit modeEntering tops up a baseline if the file on disk differs from the newest snapshot; leaving records the final content of the session if it changed
External changeAnother editor, a script or a sync client changed the file on disk — the change is detected and recorded
Opening the fileIf the file changed while mdpeek was closed, opening it records a snapshot when disk content differs from the newest version (also subject to the recording interval)
Closing the windowOne last check before a normal exit, so content that never reached the database is captured

Recording every autosave would bury the timeline under "typed two characters" versions, so automatic recording has a 3-minute merge window: autosaves less than 3 minutes after the previous version are merged, and a new version is created once the window has passed.

Some actions bypass the window: manual Ctrl+S, the top-up when entering or leaving edit mode, and closing the window normally all check and record immediately (no change, no new version). Manual save is an explicit "archive this" intent; leaving an edit session and closing the app mark the end of a session, and neither should be silently swallowed.

If 3 minutes feels too coarse or too eager, change it under Settings → General → Version history interval, in minutes. 0 means no limit — every save is checked (a new version only appears when the content actually changed). The change takes effect in the current window immediately.

Restoring: two clicks, and a way back

Click "Restore" on a version and the button first turns into "Confirm restore?" — click again within 3 seconds to run it. That is the guard against a misclick. Restoring does two things:

  1. It first snapshots what is currently on disk, labelled "automatic before restore", so a wrong choice can itself be undone;
  2. It writes the chosen version back to the file. The preview then refreshes through the file watcher — no need to reopen anything.

Restore writes content back into the original file rather than opening a read-only snapshot. Other editors, sync clients and build scripts see the same new content — much like a Git checkout. Know that before you click.

Comparing: any two versions, side by side

Looking at one version on its own rarely answers "which one is better". Every row in the history panel has "left" and "right" buttons: pick one version for the left side and another for the right, and a full-screen comparison opens as soon as both are chosen.

  • Side-by-side or inline: two columns, or a single inline view that shows insertions and deletions in place;
  • ⇄ swap: got left and right the wrong way round? One click exchanges them;
  • Any two ends: each dropdown can select "current file" or any recorded version, including hidden ones;
  • Read-only: the comparison never modifies the file — close it when done, and go back to "Restore" if you want to adopt a version.

The nicest use case is after a big rewrite you are unsure about: put "before" on the left and "after" on the right and you can see at a glance which sentence disappeared and which paragraph is new. It is especially useful with AI edits — AI tends to polish away your own wording, and whatever you think of the result, you should at least see exactly what it touched.

Comparing two files from the command line

If the two things you want to compare are two different Markdown files rather than two versions of one file, open a standalone comparison window from the command line:

mdpeek --diff old-plan.md new-plan.md

It supports the same side-by-side / inline modes and ⇄ swap, and Esc closes it. This entry point is a Pro feature and works on Windows, Linux and macOS.

Where the data lives — and whether it is uploaded

History is a local SQLite file: %LOCALAPPDATA%\mdpeek\history.db on Windows, and the equivalent user cache directory on macOS and Linux. It exists only on your machine, is never uploaded, and needs no network.

Content is deduplicated by hash — identical content is stored once — so repeated saves with no changes do not inflate the database. History is authoritative data, not a cache: upgrading mdpeek or clearing the cache will not delete it. The flip side is that deleting that file deletes the history on that machine, so keep normal backups for documents that matter.

A few limits worth knowing

  • It is a Pro feature: the Community Edition's right-click menu has no "Version history". Pro starts with 100 free full-featured opens, then a one-time $9.99 per-device buyout;
  • "View" is plain text: you see the Markdown source, not the rendered page. To check the layout, restore to a scratch copy or read the changes in the comparison window;
  • History follows the file path: move or rename the file and it is treated as a new document, with history starting from zero at the new path. Name important milestones, and leave long-term archiving to Git or your backup drive;
  • It is not Git: no branches, merges, remote sync or multi-person conflict handling. It solves "I am editing one file alone and I want to go back".

Three steps: ① open a document you are working on in mdpeek Pro and press Ctrl+S once; ② edit a few things, then right-click → "Version history" and look at the timeline; ③ pick two versions with "left" and "right" and check the changes in the comparison window. To return to one, press "Restore" twice.

Version history makes sure you can go back; tabs make sure everything fits. If you have not tried the 2.0 tabbed mode yet, continue with Every document, one window: tabbed preview in mdpeek 2.0.