---
title: migrations rollback
description: Reverts a previous migration that was executed with migrations run, restoring affected stories in a Storyblok space based on a snapshot saved by migrations run.
url: https://www.storyblok.com/docs/tooling/cli/migrations-rollback
---

# migrations rollback

Reverts a previous migration that was executed with `migrations run`, restoring affected stories in a Storyblok space based on a snapshot saved by `migrations run`.

## Prerequisites

-   A snapshot file generated by `migrations run` is required to perform the rollback.

## Usage

```bash
storyblok migrations rollback [arguments] [flags]
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| Snapshot file | string | _Required._ The full name of the snapshot file generated by `migrations run`. |

## Flags

| Flag | Type | Description |
| --- | --- | --- |
| `--space` | integer | _Required._ The ID of the Storyblok space to perform the rollback for. |
| `--path` | string | _Optional._ Specify a custom path for snapshot files. Defaults to `.storyblok/migrations/<space-id>`. |

## Examples

The following examples assume that a `space` has been defined in a configuration file.

```bash
# Rollback a migration in the specified space
storyblok migrations rollback hero-section.1770129788914.js
```

## Pagination

-   [Previous: migrations generate](/docs/tooling/cli/migrations-generate)
-   [Next: migrations run](/docs/tooling/cli/migrations-run)
