---
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 no `changeset-file` is passed, the command lists available changesets and prompts for one, unless `--latest` selects the most recent automatically.

Applying a rollback writes a new changeset capturing the rollback operation itself, so the rollback itself can be reverted.

## Prerequisites

-   A changeset file generated by a previous `schema push` is required to perform the rollback.

## 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 auto-pick. |

## Flags

| Flag | Type | Description |
| --- | --- | --- |
| `--space`, `-s` | integer | _Required._ The ID of the Storyblok space to roll back. |
| `--path`, `-p` | string | _Optional._ Base path where changesets are stored. |
| `--dry-run` | boolean | _Optional._ Show what would be undone 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 that a `space` has been defined in a 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: schema push](/docs/tooling/cli/schema-push)
-   [Next: schema validate](/docs/tooling/cli/schema-validate)
