rollback
Roll back a secret to a previous version.
The rollback command reverts a secret to a previous version from its history.
Usage#
redenv rollback [key]Arguments#
| Name | Required | Description |
|---|---|---|
key | No | The secret to rollback (interactive selection if omitted) |
Options#
| Flag | Description |
|---|---|
-p, --project <name> | Project name |
-e, --env <env> | Environment |
-t, --to <version> | Specific version number to rollback to |
Examples#
Rollback interactively#
redenv rollbackRollback specific key#
redenv rollback API_KEYRollback to specific version#
redenv rollback API_KEY --to 2Interactive Flow#
$ redenv rollback
? Select a project: my-app
? Enter your Master Password: ********
? Select an environment: development
⠋ Fetching keys...
? Select a secret to roll back: API_KEY (3 versions)
⠋ Fetching history...
✔ History fetched.
Available rollback versions:
┌──────┬───────────────┬────────────────┬─────────────────┐
│ Version │ Timestamp │ User │ Value │
├──────┼───────────────┼────────────────┼─────────────────┤
│ 2 │ 1/15/2026, 4:00 PM │ dev@example │ sk_old_value │
│ 1 │ 1/10/2026, 2:30 PM │ dev@example │ sk_original │
└──────┴───────────────┴────────────────┴─────────────────┘
? Select a version to roll back to: Version 2 (by dev@example)
? Are you sure you want to roll back "API_KEY" to version 2?
This will create a new version with the value: "sk_old_value" Yes
⠋ Rolling back secret...
✔ Successfully rolled back "API_KEY" by creating a new version with the content of version 2.How Rollback Works#
Rollback doesn't delete history. Instead, it:
- Reads the old version's value
- Creates a new version with that value
- The new version becomes the latest
Info
This design preserves the complete audit trail. You can always see when and why a rollback occurred.
Requirements#
- The secret must have at least 2 versions
- You cannot rollback to the current (latest) version
Related Commands#
- history view - View version history
- edit - Modify to a new value instead