---
title: "oz0 secret rollback"
description: "Bring back a secret's previous value, within 24 hours of the set that replaced it."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/secret/rollback"
---
# oz0 secret rollback

> Bring back a secret's previous value, within 24 hours of the set that replaced it.

For: Operators and developers looking up a command.

Bring back a secret's previous value, within 24 hours of the set that replaced it.

The previous value and the live one swap: every edge's next call uses the restored value, and the value it replaces
is kept until the same time, so a second rollback undoes the first. After the 24 hours the previous value is destroyed
and the rollback says so. Each rollback is audited (secret.rollback).

A secret that is a reference to a secret store, and whose store changed its value, goes back to the store's previous
version instead: the reference is pinned to it (store:\<store>/\<path>@\<version>), and a second rollback unpins it.

## Usage

```bash
oz0 secret rollback <NAME> [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --reason
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      why, for the audit trail
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      tenant
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
