1--- 2layout: "docs" 3page_title: "kv rollback - Command" 4sidebar_title: "<code>rollback</code>" 5sidebar_current: "docs-commands-kv-rollback" 6description: |- 7 The "kv rollback" command restores a given previous version to the current 8 version at the given path. 9--- 10 11# kv rollback 12 13~> **NOTE:** This is a [K/V Version 2](/docs/secrets/kv/kv-v2.html) secrets 14engine command, and not available for Version 1. 15 16 17The `kv rollback` command restores a given previous version to the current 18version at the given path. The value is written as a new version; for instance, 19if the current version is 5 and the rollback version is 2, the data from version 202 will become version 6. This command makes it easy to restore unintentionally 21overwritten data. 22 23## Examples 24 25Restores the version 2 of the data at key "creds": 26 27```text 28$ vault kv rollback -version=2 secret/creds 29Key Value 30--- ----- 31created_time 2019-06-06T17:07:19.299831Z 32deletion_time n/a 33destroyed false 34version 6 35``` 36 37## Usage 38 39There are no flags beyond the [standard set of flags](/docs/commands/index.html) 40included on all commands. 41 42### Output Options 43 44- `-format` `(string: "table")` - Print the output in the given format. Valid 45 formats are "table", "json", or "yaml". This can also be specified via the 46 `VAULT_FORMAT` environment variable. 47 48### Command Options 49 50- `-version` `(int: 0)` - Specifies the version number that should be made 51current again. 52