# Manage history

Use these when you need to move the journal — not for the everyday apply loop. Open **Migrations** with a folder already linked.

## Restore to an earlier migration

On an older **Applied** migration, choose **Revert** in the header, or **Restore to here** in the list. Review the rollback SQL, then **Restore database**. Later migrations are unapplied.

## Bundle pending files

Shift-click a contiguous range of **Pending** migrations, then **Bundle**. Fakebase merges them into one file. The bundled file is not applied automatically — [apply it](https://fakebase.studio/docs/apply-migrations.md) when you are ready.

## Delete or discard

**Delete migration** removes the last file in the journal. For a drift file that should not be kept, **Discard changes** can roll back Postgres. Optionally delete the file on disk at the same time.

If an **Applied** file was edited on disk, Fakebase marks it **Modified**. Restore that file before you apply, bundle, or revert.

## Move or reset

**Move into repository** moves the project into the repository folder you choose. The migrations go into a `migrations` folder inside it, and every file is copied and checked before the old folder is removed.

**Reset migrations** clears the migration history. Reset does not undo schema that is already in PostgreSQL. [Set up migrations](https://fakebase.studio/docs/migrations.md#set-up-migrations) again when you're ready.

---

## Next steps

- [Migrations](https://fakebase.studio/docs/migrations.md): Keep schema changes as SQL files in your repo, in sync with the database you have open.
- [Apply and review](https://fakebase.studio/docs/apply-migrations.md): Review a pending migration and apply it to the database.
