Restore a database to a point in time
d1 & hyperdrive
// what it does
D1 keeps a continuous 30-day history. info reports the current bookmark and state; restore rolls the entire database back to a timestamp or bookmark — the fast recovery path after a bad migration or an accidental DELETE with no WHERE. No manual snapshot needed.
// shell
$ wrangler d1 time-travel info <database>$ wrangler d1 time-travel restore <database> --timestamp=2026-07-12T00:00:00Z// gotcha
Restore overwrites current data (the pre-restore state itself stays within Time Travel). You can restore with --bookmark=<id> from info instead of --timestamp, but timestamps must fall within the last 30 days.