Skip to content

Compare and restore versions

Before you begin

Role
Viewer or higher to compare versions and Editor or higher to restore a version.
You need
  • A mock that has been changed at least once

MockHub keeps a mock’s earlier versions, so you can see what changed, and undo a change by restoring the mock as it was.

Each time an existing mock changes, MockHub keeps a copy of the mock as it was just before: when it is saved in the app or by an AI assistant, when a version is restored, and when a configuration document is applied. The column Snapshot names that change under the version’s name: Replaced by an edit, Replaced by restoring an earlier version or Replaced by a configuration apply.

A version holds the mock’s name, what it matches, all of its responses with which one answers (the default, or a sequence), and its scenario attachment. A change of the default alone is a change like any other, so it adds a version, and restoring one puts back every response and the selection together: a restored default always names a response the restored mock has.

  1. On the project’s Mocks tab, select the mock’s name.

  2. Select History. It appears once the mock has at least one earlier version.

  3. Find the version in Version history, newest first. Each row shows the version’s name and the change that replaced it, its method, path and status code under Matched, and under When the time and who made that change.

  4. Select Compare on the version’s row. The dialog lists, under Compared with the mock as it stands, every part that differs. To compare with another version instead, choose it in Compared with.

  5. Select Restore version followed by its number, such as Restore version 3.

  6. Select Restore version 3 in the dialog Restore version 3?.

Compare shows each part once, marked line by line with what restoring the version changes: a line marked − is in the mock Now, and a line marked + is in This version. With another version chosen in Compared with, a line marked − is in that version, such as Version 2, instead. Restoring still replaces the mock as it stands, and the dialog says so. Unchanged lines away from a change are folded; Show unchanged lines shows them.

The page’s address names the comparison, so a link to it opens the same one.

Restore on a version’s row does the same without comparing first.

An AI assistant connected with a personal token can list a mock’s versions, compare one with the mock or with another version, and restore it too, such as when you ask it to undo my last change to the Create order mock.

MockHub shows Restored version 3, and the mock answers as it did in that version from the next request. The mock as it was before the restore is kept as a new version, so a restore can be undone the same way.

If the version was attached to a scenario, or a scenario state, that no longer exists, the mock is restored without the attachment and MockHub says so, for example:

Scenario "payment" no longer exists — the mock was restored without a scenario attachment.
  • Each mock keeps as many versions as the workspace’s plan allows; saving another drops the oldest. The limits page lists the number per plan.
  • Versions count towards the workspace’s configuration storage limit, with the mocks themselves.
  • Creating a mock does not make a version, so the oldest version is the mock as it was created, and a mock nobody has changed since has no history.
  • A version does not record whether the mock was Active or Inactive, so restoring one leaves that as it is, and a save that changes only the status adds no version.
  • Deleting a mock deletes its versions. Only mocks have versions: scenarios, chaos profiles and project settings do not.
  • Only versions the plan still keeps can be compared, and a part that changed is shown whole, its changed lines marked.

Report a problem with this page