# Versioning

### Overview

Brainboard provides a native versioning mechanism that allows you to **keep track** of your changes and **rollback/restore** any specific point-in-time version.

*This article lists the information that is saved for each version in Brainboard, in addition to steps for creating a new version, viewing already saved versions and restoring an existing version.*&#x20;

***

### Components of a version

When you create a version, Brainboard saves the following information:

✅ The architecture design.

✅ The version of the cloud provider selected to create the architecture.

✅ Variables.

✅ Output.

✅ The README file.

✅ The structure of the Terraform files.

✅ Timestamp in UTC when the version is created.

✅The person who created the version.

✅ The commit message.

{% hint style="info" %}
The Terraform code is automatically generated, and it is not saved as code.
{% endhint %}

***

### How to create a version?

To create a version of your architecture, you can follow these steps:&#x20;

1. Click on the version history icon in the top navigation bar. The <mark style="color:$primary;">**Version history**</mark> will open in the right pane.&#x20;
2. Click the <mark style="color:$primary;">**`New version`**</mark> button on the <mark style="color:$primary;">**Version history**</mark> pane.&#x20;

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FRQMMnqIgJ45bpa8X56gS%2Fimage.png?alt=media&#x26;token=7398764c-dc4d-4d24-b4c8-f1ef7949c275" alt=""><figcaption></figcaption></figure>

3. On the **Create new version** popup modal, you can enter the description of the version and click <mark style="color:$primary;">**`Create`**</mark> to save.&#x20;

{% hint style="info" %}
The version description could be the same commit message you would write when performing a **pull request**.  You can write multiline text if you want to provide more details.
{% endhint %}

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FkdIrsdaV4t0bzh57P2vp%2Fimage.png?alt=media&#x26;token=adc19b4f-fffc-4f22-9e96-c53f7aa2b599" alt=""><figcaption></figcaption></figure>

4. When a version is created and saved, it's listed on the <mark style="color:$primary;">**Version history**</mark> pane on the right side.&#x20;

{% hint style="success" %}
Each new version that's created also displays the **name of the user** who created along with the **time/date** it was created.
{% endhint %}

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FCvriuhmKk3g8txhPeirr%2Fimage.png?alt=media&#x26;token=8eb627f3-b1bf-4c16-8912-dfc4460a0fa5" alt=""><figcaption></figcaption></figure>

***

### View available versions

If you want to view the list of available versions of your architecture design, click on the **version history icon** in the top navigation bar. The **Version history** pane will expand on the right side of the screen.&#x20;

{% hint style="info" %}
The versions are listed in order of **latest/newest** to **oldest.**&#x20;
{% endhint %}

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fd07WcfSY7UNjhaQ7ksF3%2Fimage.png?alt=media&#x26;token=58748a4d-31ef-42a4-b995-37401930dd32" alt=""><figcaption></figcaption></figure>

***

### How to restore a version?

To restore any version, click on the **version history icon** in the top navigation bar. On the **Version history** pane on the right side, click on the **version** you want to restore.  The clicked version will be restored, and the following success message will be displayed at the bottom of the **Version history** pane.

*<mark style="color:green;">Architecture version restored successfully.</mark>*&#x20;

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2F7dxiRW066thRlVOtS8zH%2Fimage.png?alt=media&#x26;token=29a9509f-5f54-4d2b-b231-d1dbe41b5373" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**IMPORTANT**

* Brainboard versions are immutable snapshots of your infrastructure. You cannot delete them.
* You can check out any version and work on it without altering the history of the versioning.
* When you clone an architecture or create a template from it, its versions will be removed.
* When you checkout a version, both the diagram and the Terraform code will be updated.
  {% endhint %}

***

### Push to git

Please refer to the [<mark style="color:$primary;">**`Pull requests`**</mark>](https://docs.brainboard.co/cloud-design/autogenerated-code/pull-requests) page for detailed information on how to do pull requests and save the generated code into git.
