Skip to main content
On this page

Kater CLI Delete and restore

kater restore

Restores a delete from the Trash, in one change.

The object comes back with what went with it and the rows that Kater kept, such as its grants and pins. Each fix made for it since the delete is taken back, unless you keep it.

Examples

Terminal window
# List the Trash, with each delete's id
kater trash list
# See what comes back, what reads it again and each fix that the restore takes back. Nothing changes.
kater restore 3f1c9a20-5b7e-4d21-9a0e-1c2d3e4f5a6b --dry-run
# Restore it
kater restore 3f1c9a20-5b7e-4d21-9a0e-1c2d3e4f5a6b
# Restore it under another name, when a newer object took its name
kater restore 3f1c9a20-5b7e-4d21-9a0e-1c2d3e4f5a6b --name sessions_before

Arguments

ArgumentDescription
<id>The delete’s id in the Trash, as kater trash list and kater rm give it.

Options

OptionDescription
--dry-runShow the plan, as the Restore dialog shows it, and change nothing.
--name <name>Its name when it comes back, when a newer object took its name: lower case letters, digits and underscores.
--keep <fix>A fix made since the delete that stays as it is, by its id as --dry-run prints it. You can give it more than one time.

It also takes the global options --json and --help.

What comes back

  • The object and what went with it. When its folder was deleted too, the folder comes back.
  • Each fix is taken back. What reads it reads it again. --keep keeps a fix.
  • Other changes stay. Changes made since the delete to other files stay as they are.
  • A taken name stops the restore. When a newer object has its name, the command says so and gives a name for --name.

What it answers

It gives what came back, the number of objects that read it again and the number of fixes that Kater took back. The last line is the kater undo command that puts it back in the Trash. kater git pull brings the restore to your local copy.

See also