Using Replit Agent? Learn how to add a configured Postgres database to your apps with a single prompt
Docs/Features/Branching/Branch reset and restore

Branch reset and restore

Learn about the different branch reset and restore features in Neon

Neon retains a history of changes for all branches. This shared history provides the basis for a variety of branch restore and reset operations: resetting a branch to its parent, restoring a branch to its history, creating a new branch from a selected point-in-time, and Time Travel queries against the shared history. You can use these features to reset a development branch to main, to recover lost data, as a database backup strategy, or to view the past state of your database.

History retention

By default, Neon's history retention window is set to 1 day across all plans to help you avoid unexpected storage costs. Increasing your retention window gives you a better range for your reset and restore operations, but it can also increase storage costs. The history retention limit is up to 24 hours for Neon Free Plan users, 7 days for Launch, 14 days for Scale, and 30 days for Business plan users.

You can configure the History retention setting in the Neon Console, under Settings > Storage. For further instructions, see Configure history retention. History retention configuration

Increasing the history retention period affects all branches in your Neon project and increases project storage. You can scale History retention down to zero if reducing storage cost is more important than the ability to restore your data to a past state.

History is retained in the form of Write-Ahead-Log (WAL) records. As WAL records age out of the retention period, they are evicted from storage and no longer count toward project storage.

Branch reset and restore features

Find out more about the different branch reset and restore features that Neon provides.

Last updated on

Was this page helpful?