# Local History

Source: https://athas.dev/docs/local-history

Every save is kept, so you can look back at a file and restore it without a commit.

Athas snapshots a file every time you save it. Nothing is committed and nothing leaves your
machine: this is the safety net for the edits that happen between commits.

## Open it

Run **File: Local History** from the command palette with the file open. You get the file's
snapshots, newest first, with how long ago each one was saved.

Pick one to read it, or restore it over the current contents.

## What is kept

The last **50 saves per file**. The oldest is dropped as a new one arrives, so an afternoon of
frequent saving will not keep yesterday's morning.

Snapshots are stored under the application data directory, in a folder named for a hash of the
file's path. Renaming a file starts a new history; the old one stays under the old path until it
ages out.

## What this is not

- Not a backup. It is local, per machine, and bounded at 50 entries.
- Not version control. Use [Git](https://athas.dev/docs/git-integration) for anything you want to keep, share or
  reason about across machines.
- Not a record of unsaved work. A snapshot happens on save, so an editor you never saved has no
  history.

## Restoring

Restoring writes the snapshot over the file on disk and leaves a new snapshot of what was there
before, so a restore you did not mean is itself undoable.
