avr restore

Returns the current environment to a snapshot captured with avr snapshot. Changes made inside Linux since that snapshot are lost. Your project files are shared, not part of the snapshot, and not touched.

  1. Help
  2. Examples
  3. What it does
  4. Exit status
  5. Errors
    1. snapshot does not exist
    2. missing name
    3. does not support snapshots
  6. See also

Help

This is exactly what avr help restore or avr restore --help prints.

Usage:
  avr [selector flags] restore <name>

Restore the selected environment from a named snapshot. Snapshots are available only in environments whose backend supports them.

Selector flags such as --arch and --distro must come before the command; run `avr --help` to see them.

Examples

avr snapshot                       # see which snapshots exist
avr restore before-upgrade         # go back to one
avr --arch amd64 restore clean     # restore the amd64 environment

What it does

avr restore acts on the environment the selector flags and .avr.toml resolve to, and restores it to the named snapshot. It does not ask for confirmation.

It prints Restoring <environment> to snapshot "<name>"… on standard error while it works, and Restored <environment> to snapshot "<name>". when done.

Exit status

Status When
0 Restored
1 No snapshot has that name, the environment cannot be snapshotted, or the backend failed
2 No name, more than one argument, or an unsupported environment

Errors

snapshot does not exist

avr: snapshot does not exist: <details>
Available snapshots for <environment>: <names>

When there are none at all, the message says so instead of listing them. Exit status 1.

missing name

avr: `avr restore` needs the name of a snapshot to restore; run `avr snapshot` to see the ones available for this environment

Exit status 2.

does not support snapshots

On macOS, a native-architecture environment refuses with the same message as avr snapshot. Exit status 1.

See also