Docly Developers
Knowledge base Clarification By design

Which documents keep a version history

In shortA document gets a new version on every save when its schema has EnableVersioning turned on and the workspace's subscription includes Revisions. The platform schemas behind templates, scripts, stylesheets, uploads and images (Code File, Uploaded File, Uploaded Image) all have versioning on. Only documents without a schema - typically JSON a script saves with saveFile and no schema - never have a history. Read and compare versions in the editor's History dialog or with docly history; turning Revisions off stops new versions but keeps the old ones.
Applies to SchemasDocumentsdocly CLI
  1. What you'll see

    You open the History of a document and the list is empty, or docly history answers that the document is not versioned. Or you expected to roll back a file a script wrote, and there is nothing to roll back to.

  2. What's actually happening

    Docly stores a version of a document each time it is saved, but only when both of these are true:

    ConditionWhere it is set
    The document's schema has EnableVersioning turned onThe schema document
    The workspace's subscription includes RevisionsThe subscription (depends on the plan)

    Most files on a site have a schema, and it versions. A file is stored with the schema its extension maps to. The platform schemas all have EnableVersioning on:

    SchemaFiles
    Code FileText files: .hash, .js, .css, .html, .json, .md, .svg, .txt and other code and config formats
    Uploaded ImageImages
    Uploaded FileOther uploads (PDF, ZIP, binary files)

    For an upload, the version holds the document's values, which point to the stored file. The file itself is kept as long as a version refers to it, so an older version can be restored with its file.

    A workspace can override a platform schema with its own schema of the same name; then that schema's EnableVersioning decides.

    Documents without a schema have no history at all. The usual source is a script: docly.saveFile(path, data) without a schema creates a schemaless file (this is how counters, logs and cached JSON are meant to be stored). Saving such a file overwrites the previous content. docly history shows Versioned: false for them.

    The rule is the same for every way a document is written: the editor, the docly CLI and MCP, the AI assistant, unzipping, package installs and your own scripts. None of them can create a version the rule does not allow, and none of them skips one it does.

    Turning Revisions off stops new versions only. The versions that already exist are kept and can still be opened, compared and restored. The History dialog says when the subscription has turned versioning off, so an empty list is not mistaken for a document that never changed.

  3. What to do

    Read and compare versions

    In the editor, open History on the document. From the command line:

    docly history <document>                      # list the versions
    docly history <document> --version 3            # print version 3
    docly history <document> --version 3 --diff     # what changed since version 3
    docly history <document> --version 3 --label "before redesign"
    docly history <document> --version 3 --out old.json

    To restore an older version from the command line, write it to a file with --out and put it back with docly put. Restoring creates a new version; nothing in the history is removed.

    Still review before you save

    A version lets you go back after a mistake has gone live; it does not stop the mistake from going live. Templates and scripts are where a mistake takes a site down, so work on them in a docly CLI working copy and use docly diff before anything is pushed — see Use a docly CLI working copy instead of git and Work safely on a live site.

    Choose versioning for your own schemas

    Set EnableVersioning on schemas whose documents people edit and may want to undo: content pages, settings, data records. Leave it off for documents that scripts rewrite constantly (counters, logs, caches) — every save is a stored copy. The same goes for files your scripts save: give them no schema when they change all the time and need no history.

Last reviewed 23 Oct 2026