1. Versioning
  2. File versioning in Mage

Configure the number of versions per file

You can set how many previous versions to keep track of for every file.

Set the following environment variable name and value:

ValueAny integer value.

Where are the file versions stored?

Each file version is stored in the following directory:


For example, if your project name is demo_project, then the directory will be demo_project/.file_versions.

Please add .file_versions to your .gitignore file. For more information, please read the project setup guide.

How to view file versions

  1. Open a pipeline.
  2. Edit the pipeline.
  3. In the file browser on the left side of the page, click on a file.
  4. Near the top on the right side, click the button Show versions.
  5. A list of previous versions for that file will appear in the right side panel.

File versions

How to restore to a previous version

  1. In the right side panel, click on a previous version.
  2. Click the button labeled Replace with this version.
  3. The contents of the file will be updated with the contents from the previous version.