# Version history and rollback

URL: https://kywi-docs-production.up.railway.app/governing/version-history-and-rollback
Type: docPage

A restore brings back an old version's fields and layout, takes its status only if your role could make that move, and is itself saved as a new version.

Every save, publish and unpublish, and every workflow transition — submit, approve, reject — writes a new version snapshot: the row's fields and layout as they stood at that moment, numbered in sequence. Version history isn't something you maintain separately; it accumulates on its own every time content is edited or moves through the workflow.

## What restoring a version does

Restoring writes a version's fields, layout and content-type custom fields back onto the live row. The layout goes back through the same validated write path an ordinary save uses, so if the module set has changed enough that the old layout no longer parses, the whole restore is rolled back rather than reviving a page nobody can open in the editor. Restoring isn't a rewind, either: it creates a new version recording the restore itself, so the state you just replaced is one step back in history, not erased.

## A URL Override another page has taken is dropped

If the snapshot carries a URL Override that another page has since taken, the restore still goes ahead but leaves the override empty and says so: the editor appends a warning to the restore notice, and the API response carries `restoreWarning`. Restoring a page from Trash behaves the same way, though the Trash screen does not display the warning. Publishing a changeset or approving a revision drops a taken override too, reporting it only in the API response and the audit record.

## Who can restore

Restoring needs editor or above. The status part of a restore follows the same ladder as any other status change, so a restore never moves a page further than your role's ordinary publish or unpublish could.

## A restore checks your role, your site and the page's permissions

A restore takes the snapshot's status only when your role could move the page from its current status to that one through the ordinary workflow. Otherwise the page keeps its current status and publish date, the rest of the restore still goes ahead, and the notice says so: "Status stays published: your role cannot change it to archived." An editor restoring an old draft of a published page gets the old copy, still published; taking it down remains a site admin's move. Site admins and super admins can reach any status this way. A restore also needs access to the page's site and, when the page carries document permissions, a write grant on it, which site admins of that site bypass. Earlier versions applied the snapshot's status with no check and gated the restore on the editor role alone.

What each of the six roles can otherwise do, on content and across the rest of the admin, is [Roles and the capability matrix](/governing/roles-and-the-capability-matrix/). The queue a page's status normally travels through is [Reviewing and approving submissions](/governing/reviewing-and-approving-submissions/).

## History is capped per item — by deletion

Every save, publish, unpublish, revision approval or rejection and changeset publish that writes a version also prunes: the item keeps its newest 100 versions, plus its most recent snapshot taken while published, and every other one is deleted from the database, not archived. A developer changes the cap with `versioning.maxVersionsPerItem` in the project config. Earlier versions kept a fixed fifty, with no published snapshot protected. Creating a page now records its first state as a version too, and a save whose snapshot fails still succeeds, with a warning on its notice that it has no rollback point. Submitting a pending revision does not itself trigger a prune — but the revision has no immunity from the cap once one does run. If more versions than the cap pile up on that content item before anyone reviews it, the pending revision is deleted along with the older ones. Once a version is pruned, restoring it is not an option this page can offer; the only place an older state still exists is a database backup taken before it aged out ([Backups: what Kywi does not do for you](/operating/backups-what-kywi-does-not-do-for-you/)).
