# restore

> Put a trashed item back

*Changes something.*

Put a trashed item back.

Expects revision, the revision the trash returned, and takes the trash root's ID as the
trash listing names it. A whole subtree comes back together. In a personal space only
the item's owner restores it, as only they could have trashed it; a place they can no
longer use is not_found, and naming their own root with to lands it there instead. to
lands it somewhere other than where it was and name gives it another name. A restore
stays in its space, with one exception: the owner of an item in a personal space may
restore it into a folder of another personal space they hold editor on — their own root,
when the place it was is gone — and that restore is previewed as a move between personal
spaces is. Any other restore into another space, into an organization's or out of one,
is refused with cross_space; restore it where it was, then move it. A restore that names
a folder can broaden access exactly as a move within a space can, and carries
acknowledge for the same reason; a restore to where the item was cannot. On
revision_conflict nothing was written: read the item again, work out what the change
means against what is there now, and run it again with the newly observed revision.
Never fetch a fresh revision merely to push a stale change through.

Read a revision from the stat tool, a listing, a search, the status tool, or any
change's own result.

This change takes a key you choose, fresh for this change. If its result never reaches
you, call again with the same key and the same arguments, or ask the status tool with
that key: the same key and the same input is one change, made once.

## Arguments

| Argument | Type | Required | Meaning |
| --- | --- | --- | --- |
| `trash_root_id` | text | yes | The trashed item to put back, as the trash listing names it |
| `revision` | text | yes | The revision this change expects to find |
| `to` | text | no | A folder to land in, instead of where it was |
| `name` | text | no | A new name to land under |
| `acknowledge` | text | no | The digest an access_broadens or access_narrows refusal carried, once the user says go ahead |
| `key` | text | yes | A key you choose for this change, fresh each time; repeat it to settle a lost result |

## On the command line

```sh
flie agent restore TRASH_ROOT_ID --revision REV [--to FOLDER_ID] [--name NAME] [--acknowledge DIGEST] [--key OPERATION_KEY]
```

```sh
flie --json agent restore TRASH_ROOT_ID --revision REV [--to FOLDER_ID]
```
