---
title: Undo, redo & history
description: Step back from any change, and replay a recorded session.
sidebar:
  order: 5
---

import Demo from '../../../components/Demo.astro';

Every change you make is safe to undo — the playground snapshots the whole
project before each one.

<Demo src="/casts/undo-redo.cast" title="Undo a row back out, then redo it — each step asks for confirmation." />

## Undo and redo

```rdbms
undo
```

```rdbms
redo
```

Each asks you to confirm, naming the exact command being undone or
re-applied. Redo is available until you make a new change. (How snapshots
work is explained in [Concepts](/concepts/projects-and-storage/).)

Starting with `--no-undo` turns this off for the session — no snapshot is
taken before each change, and `undo`/`redo` report that undo is off.

## History and replay

Every command you run is recorded, in order, in the project's `history.log`.
You can re-run a saved sequence of commands from a file:

```rdbms
replay path/to/commands
```

Replay runs each non-blank, non-`#`-comment line, stopping at the first error
(relative paths resolve under the project directory). It re-applies the
schema- and data-changing commands and skips app-level ones.
