---
title: "Compare and restore earlier versions of a snippet - Code Snippets"
description: "Every save keeps a copy of your snippet. Compare any 2 versions side by side and put an older one back in 1 click."
url: "https://www.tassos.gr/docs/code-snippets/functionality/versions"
date: "2026-11-22T13:09:41+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/docs) / [ Code Snippets ](https://www.tassos.gr/docs/code-snippets) / [ Functionality ](https://www.tassos.gr/docs/code-snippets/functionality)

#  Compare and restore earlier versions of a snippet

##  Every save keeps a copy of your snippet. Compare any 2 versions side by side and put an older one back in 1 click.

Every time you save a snippet, Code Snippets keeps a copy of it, the same way Joomla keeps versions of articles. When a change breaks something, you can see exactly what changed and put the earlier code back in 1 click.

   Your browser does not support the video tag.

Versions are new in Code Snippets 1.0.3. Until 1.0.3 is out, you'll find them in the [latest beta](https://www.tassos.gr/releases/code-snippets-beta).

## [What a version keeps](#what-a-version-keeps)

A version holds everything on the snippet's edit screen: the code, the code type, the location, the [publishing rules](https://www.tassos.gr/docs/code-snippets/functionality/conditional-logic), the status, the category and the rest. Restoring a version brings all of it back.

A save only adds a version when something changed. Click Save twice in a row and you still get 1 version.

## [Add a note to a save](#add-a-note-to-a-save)

A short note makes a version easy to find later, like "Before the redirect fix" or "Greet members by name".

1. Log into your Joomla backend.
2. Go to **Components** → **Tassos Code Snippets**.
3. Open the snippet.
4. Make your changes, then type the note in the **Version Note** field on the right.
5. Click **Save**.

The note shows next to the version in the list of versions and in the compare view. The field is empty again after the save, since each note belongs to 1 save.

## [Compare 2 versions](#compare-2-versions)

1. Log into your Joomla backend.
2. Go to **Components** → **Tassos Code Snippets**.
3. Open the snippet.
4. Click **Versions** in the toolbar. A window lists every version with its date, note, Keep Forever setting, author and character count.
5. Tick the 2 versions you want to compare.
6. Click **Compare**.

[![The compare view of 2 snippet versions: the old code on the left with the removed line in red, the new code on the right with the added lines in green](https://www.tassos.gr/images/2026/11/code-snippets-versions-compare.jpg)](https://www.tassos.gr/images/2026/11/code-snippets-versions-compare.jpg)

The compare view shows the 2 versions next to each other:

- **Old** on the left is always the older version and **New** on the right the newer one, whichever order you ticked them in. Each heading shows that version's save date and note.
- The code sits side by side with line numbers and syntax highlighting. Removed lines are red, added lines are green, and the words that changed inside a line are marked darker.
- When a line exists on only 1 side, the other side gets an empty grey line, so the rest of the code stays lined up.
- Below the code you'll find every other field that changed, like the status, the location or the publishing rules, with the changed part marked. Fields that didn't change aren't listed.

## [Restore an older version](#restore-an-older-version)

1. Log into your Joomla backend.
2. Go to **Components** → **Tassos Code Snippets**.
3. Open the snippet.
4. Click **Versions** in the toolbar.
5. Tick the version you want back. Tick only 1.
6. Click **Restore**.

The edit screen reloads with that version's code and settings and the message "Prior version restored." with the version's date and note. The version you replaced stays in the list, so you can switch back the same way.

 Restore saves the snippet right away. If the snippet is published, the restored code runs on your site as soon as you click Restore.

## [Keep or delete versions](#keep-or-delete-versions)

Code Snippets keeps the last 10 versions of each snippet and deletes the oldest one as you save a new one. To keep a version past that limit, tick it and click **Keep On/Off**. Its **Keep Forever** column switches to Yes. Click **Keep On/Off** again to undo it.

To clear out versions you don't need, tick them and click **Delete**.

## [Turn versions off or keep more of them](#turn-versions-off-or-keep-more-of-them)

Versions are on by default, both on a new install and after you update from an earlier release.

1. Log into your Joomla backend.
2. Go to **Components** → **Tassos Code Snippets**.
3. Click **Options** in the toolbar.
4. In the **General** tab, set **Enable Versions** to Yes or No.
5. Set **Maximum Versions** to the number of versions to keep for each snippet. The default is 10.
6. Click **Save & Close**.

With **Enable Versions** set to No, the Versions button and the Version Note field disappear and saves stop adding versions. The versions you already have stay, and show up again when you turn it back on.

Versions live in your site's database, next to the snippet. For a copy outside your site, [export your snippets](https://www.tassos.gr/docs/code-snippets/functionality/import-export) to a file.

 Last updated on Nov 5th 2026 15:11
