# History and restore (/docs/guides/history-and-restore)

Every kuizer deletion is logged. List past runs, see what each one freed and, in trash mode, put items back.

Every deletion is logged to `~/.kuizer-history.json`. The terminal UI, the CLI and the desktop app share it. kuizer still reads `~/.sweep-history.json` from before the rename.

## List runs [#list-runs]

```sh
kuizer history
kuizer history show s4
kuizer --json history
```

`kuizer history` lists past runs with ids like `s4`, shows what each freed and, for runs made in trash mode, what is still in the trash. `history show` lists every item of one run.

## Restore [#restore]

Deletion is permanent by default, and a permanent run cannot be restored. With `delete.mode = "trash"` in the [config file](/docs/configuration), project artifacts and global caches move to the trash and `kuizer restore` puts them back. `kuizer restore` works on Linux and is not supported on macOS.

```sh
kuizer restore --last
kuizer restore s4
kuizer restore s4.2 s4.5
kuizer restore s4 --dry-run
```

A run id restores every item of the run. An item id like `s4.2` restores one. Items move from the trash back to where they were.

<Callout type="warn" title="Restore never overwrites">
  An item whose path exists again, or that already left the trash, is skipped and reported.
</Callout>

Toolchains, Docker objects and git branches are removed for good in either mode. See [Safety and deletion](/docs/concepts/safety).
