---
title: Restore a file from a backup
project: Code
version: 2.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/code/2-0/guides/backups/
updated: 2026-11-19T04:32:04.377Z
---

# Restore a file from a backup

> Go back to an earlier version of a file.

Each time you save a file, Code keeps a backup of it. The option **Backup all modified files** of the [project](../../reference/project-options/) controls this, and it is on by default.

## Restore a file

**1.** Open the file.

**2.** Click **Backups** in the Additional panel. You can also click the time of the last change in the status bar.

**3.** Click the version you want.

![The Backups panel with one saved version, its date and its author](/files/Janvrd26R61f.webp)

**4.** Check the text in the editor.

**5.** Press `Ctrl+S`, or `Cmd+S` on macOS, to save it.

The version only replaces the text in the editor. The file on the server stays the same until you save.

## Restore only a part of a file

1. Select the lines you want to bring back.
2. Click the version in the **Backups** panel.

Code replaces only the selected lines.

## Delete the backups of a project

1. Open **Projects** in the main bar.
2. Check the project.
3. Click **Selected** and choose **Clear backups**.
4. Confirm your choice.

This deletes every backup of the project and can't be undone.
