Skip to main content
ABTestly keeps a version of a variation’s code every time its JavaScript, CSS or attached libraries change. History answers three questions inside the dashboard: what did this variation look like when the test launched, what has changed since, and how do I get an older version back. Versions are stored in full and kept for as long as the experiment exists. There is nothing to set up. An experiment that existed before code history starts with one version of each variation’s code as it was then.

Open History

1

Open the variation's code

On the experiment page, open a variation’s code with the code button on its row (its tooltip reads Show code).
2

Click History

History sits above the code, in the read view and in the editor. Its tooltip reads Version history.
A panel opens on the right, titled History: and the variation’s name. It lists the stored versions newest first, 50 at a time. Load older versions at the bottom fetches the next 50. Anyone who can open the experiment can open History and compare versions, Viewers included. Restoring needs more, see who can see and restore.

What each version shows

A reset from the Reset data button changes no code, so it stores no version and no badge.

Sources

Current (not yet in history)

Sometimes the list starts with an entry named Current (not yet in history). It is the variation’s code as the page loaded it, shown when that code differs from the newest stored version, or when nothing is stored yet. You can compare it like any other version. It has no Restore button, since it is the saved code. It appears for one of two reasons:
  • A save went through, but storing its version did not. The save itself is never affected. The missing code is added as a Recovered version (a Baseline, if the variation had no versions yet) the next time the experiment’s variations are saved. Launching the experiment, a scheduled start, and a data reset from Reset data or from Reset and continue when you resume also add it.
  • Someone saved after you opened the page. Your page then holds older code than the newest version. Reload the page.

Compare two versions

1

Tick two versions

Tick the checkbox on any two entries. Ticking a third one drops the one you ticked first.
2

Read the comparison

The comparison opens above the list, headed for example Comparing revision 3 with revision 5. The older version is always on the left and the newer one on the right, whatever order you ticked them in. The current code is always the newer side.
3

Switch files

variation.js and variation.css switch which file you compare.
Comparisons in History are read only. Close one with its close button (×) or Esc. The list stays as it was and the focus goes back to the checkbox or button that opened the comparison. In the panel, Esc closes an open comparison first. With no comparison open, Esc closes the panel. When the two versions have different libraries, a line under the Comparing revision heading names the difference, in the same format as Review changes: Libraries: adds <key>; removes <key>, or Libraries: same libraries in a new load order. It reads from the older version to the newer one, so adds means the newer version has a library the older one does not. When the libraries are the same, no line shows.
History panel for Variant B comparing revision 5 with revision 6 side by side, above a list of six versions with revision 5 and revision 6 ticked

Revision 5 and revision 6 compared in History. The older version is always on the left. Below the comparison, each version shows its author, time, status and source.

Quick picks

Three buttons under the panel title pick a comparison for you. “The version that was current” at a moment means: of all the versions stored at or before that moment, the most recent one. Launch is the first start, from draft or scheduled to running. Pausing and resuming does not move it. The quick picks load older versions for you when the moment falls further back than the list shows, up to 2,000 more.
History panel after Since launch, with the note No code changes since launch under the quick pick buttons and only revision 4 ticked

Since launch on a variation whose code has not changed since the test started. The note reads No code changes since launch, and only the version current at launch is selected. It is already the saved code, so there is nothing to compare.

Notes under the buttons

Restore an older version

1

Click Restore this version

In History, on the version you want back.
2

Check the draft

The panel closes and the variation’s code opens in the editor with that version loaded as an unsaved draft. When it differs from the saved code, Review changes is already on, open on a file that changed, and the button reads Back to editor.
3

Save it, or cancel

Nothing is saved until you click Save. Cancel drops the draft and leaves the saved code as it was.
  • A version that differs only in its libraries opens in Review changes with the same code on both sides. The library line under the header names what the restore adds or removes. See library changes.
  • A version identical to the saved code, with the same JavaScript, CSS and libraries, has nothing to restore. Its button is disabled with the tooltip This is already the saved code., and the same words show on its row. That happens once its code has been loaded, for example by comparing it. If you click Restore before that, the panel says so and restores nothing.
  • The save is an ordinary save. It goes through every check any save does: your access, the lock, the reset or keep data question, the library rules, the syntax check and code check. Restoring is never a way around one of them.
Inline editor in Review changes after a restore, with the line Libraries: adds dayjs under the header and the saved code next to the restored version

A restored version opens as an unsaved draft in Review changes, with the saved code on the left. This one also adds a library, named in the line under the header.

When Restore is unavailable

When you cannot restore, the panel says why near the top and every Restore this version button is disabled with the same words as its tooltip. The reasons are checked in this order: The last two exist so a restore never overwrites work you have not saved. Autosave would replace a waiting draft with the restored code within about a second, before you ever saw it. The panel checks again when a version’s code arrives. If something changed while it loaded, for example you started typing, you see Can’t restore this version with the reason, and nothing changes.

Libraries in a restored version

A version holds its library keys as well as its code, and restoring brings them back. Save sends them with the code, and the save applies the usual library rules:
  • A library the variation already has is kept, even if it has been deprecated since.
  • A library the variation does not have now counts as newly attached. That needs Dev libraries on your plan (Pro and above) and the library approved for the site under Site → Developer libraries. Otherwise the save is refused and nothing is stored. Remove the library in Libraries, or approve it, then save again.
See Dev libraries.

Autosave keeps a restored draft

After a restore, autosave treats the restored code as your draft and mirrors it to this browser within about a second, the same as your typing. It keeps the libraries too when they differ from the saved ones. If the page reloads before you save, the recovery banner offers the draft back, and Recover puts back the code and the libraries. If someone saves the variation in the meantime, the banner warns Unsaved changes found, but the saved code has changed and the button reads Recover anyway, because recovering replaces the newer saved code with your draft. The same warning appears when your draft changed the libraries and someone has since changed the saved libraries. Use Compare with saved in the banner to see both first. See Autosave and drafts.

Reference

What stores a version

These store nothing new:
  • A save that leaves the code and the libraries as they were. Changing only a variation’s weight or name, the goals, the targeting, the schedule or the traffic split stores no version.
  • Starting, pausing, resuming or archiving the experiment.
  • Autosave. Drafts in your browser never reach history.
  • Restoring. Only the save after it stores a version.
A variation’s name is not part of a version, so renaming one stores nothing. The panel title uses the name it has now. If you remove a variation, its versions are kept, but History is only offered on variations the experiment still has.

Who can see and restore

A member scoped to some sites cannot open History for experiments on other sites. See Members and roles and the Permissions catalog.

Retention and limits

  • Kept for the life of the experiment. Nothing is pruned on a timer.
  • Stored in full. Each file can be up to 500,000 characters, the same limit a save has. A version is never shortened.
  • Archiving keeps them. Versions are deleted when the experiment is permanently deleted, when its site is deleted, and when the account is closed.
The Activity log also shows code changes, but it keeps workspace changes for 6 months only, and it does not keep a file over 32 KB in full. Code history is the complete record.

Keyboard shortcuts

API

Two read only endpoints list a variation’s versions and return one version with its code. See variant code history in the REST API reference. No endpoint writes versions: they are stored only as a side effect of the saves above.

Troubleshooting

Why does a version say Recovered?

Storing a version happens after the save itself, and if it fails the save is kept anyway. Your code was saved, but the history missed that version. The next time ABTestly writes to the history for that experiment, it finds that the saved code differs from the newest version and stores the missing code as Recovered, dated when that code was saved. Until then, History shows Current (not yet in history). A Recovered version has no author recorded, because ABTestly cannot know who saved that code. Its author shows as Author not recorded. To find who saved it, look for the save in the Activity log.

Why does Since launch say History starts on a date?

The experiment launched before the oldest stored version. That happens with experiments that existed before code history: their first version is a Baseline dated at the variation’s last save. If the variation was saved after launch, the code that actually ran at launch was never stored, so History compares the oldest version it has and tells you where its record starts. The same applies to Since last reset when the last reset came before the oldest version. If the variation had not been saved since launch, the Baseline is the launch code and no note appears.

Why is Review changes greyed out right after I saved?

Once the save goes through, your draft is the saved code, so there is nothing left to compare. Open History and click Previous save to see what that save changed.

Two versions show the same code. Why are they separate versions?

Look under the Comparing revision heading. When the libraries differ, a different library or the same libraries in a new order, a line there names the difference, for example Libraries: same libraries in a new load order. Whitespace changes show in the comparison too, so check the highlighted lines as well. Two versions that are not next to each other can also hold the same code, for example when a later save put back older code.

Why does the author say Former member?

The person who saved that version no longer has an account. The version and its code are kept. A Recovered version shows Author not recorded instead, and a Baseline version shows Code before history began.

Why can’t I find History on a variation?

History sits above a variation’s code, so it is offered wherever the code is. The Original shows its code section only when it has code, and variations in a Split URL test carry a redirect instead of code, so neither offers History. A variation that was removed from the experiment has no row to open.

Can I get back code from before code history existed?

No. The Baseline is the oldest version History has. For saves in the last 6 months, the Activity log may still hold the before and after.

Does restoring change anything on my site?

No. Restoring only loads the version into your editor. Your site changes when you save, and on a running experiment that save republishes it.

Review changes

Compare unsaved edits with the saved code before you save.

Autosave and drafts

The local draft that recovery and restore both work with.

Editing a running test

What happens to your data when you change code on a test that is running.

Activity log

Who changed what across the workspace, for six months.
Last modified on September 12, 2026