---
title: schema rollback
description: Loads a changeset written by a previous schema push and reverts the Storyblok space to the state captured before that push.
url: https://www.storyblok.com/docs/tooling/cli/schema/rollback
---

# schema rollback

Loads a changeset written by a previous [`schema push`](/docs/tooling/cli/schema/push) and reverts the Storyblok space to the state captured before that push. If you don’t pass a `changeset-file`, the command lists available changesets and prompts for one, unless `--latest` selects the most recent automatically.

Applying a rollback writes a new changeset that captures the rollback operation itself, letting you revert the rollback.

## Prerequisites

The rollback requires a changeset file generated by a previous `schema push`.

## Usage

```bash
storyblok schema rollback [changeset-file] [flags]
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| Changeset file | string | _Optional._ Path to the changeset file to roll back to. Omit and pass `--latest` to pick one automatically. |

## Flags

| Flag | Type | Description |
| --- | --- | --- |
| `--space`, `-s` | integer | _Required._ The ID of the Storyblok space to roll back. |
| `--path`, `-p` | string | _Optional._ Base path of stored changesets. |
| `--dry-run` | boolean | _Optional._ Preview the rollback without applying changes. |
| `--yes` | boolean | _Optional._ Skip the interactive confirmation prompt. |
| `--latest` | boolean | _Optional._ Automatically select the most recent changeset. |

## Examples

The following examples assume you defined a `space` in the configuration file.

```bash
# Roll back the most recent push
storyblok schema rollback --latest

# Roll back to a specific changeset
storyblok schema rollback .storyblok/schema/changesets/2026-05-11T10-00-00Z.json

# Preview the rollback without applying changes
storyblok schema rollback --latest --dry-run
```

## Pagination

-   [Previous: push](/docs/tooling/cli/schema/push)
-   [Next: validate](/docs/tooling/cli/schema/validate)
