Joint session with Vercel: How to build intelligent storefronts (May 15th) →

How to restore entire dataset to previous date or undo recent changes?

6 repliesLast updated: Nov 30, 2025

Is there a way to restore an entire dataset to what it was on a previous date or undo the most recent change on all documents? Asking for a friend... 😬
AI Update

😬 I feel your friend's pain! Unfortunately, Sanity doesn't have a built-in way to do a full dataset rollback to a previous date or bulk-undo across all documents.

What Sanity DOES offer:

Document History lets you restore documents one at a time by viewing their revision history and rolling back to a previous version. You can access this through the document status indicator at the bottom of the editor or via the contextual menu (ellipsis icon) → "History".

Important limitations:

For bulk restoration:

If your friend needs to restore multiple documents, they'd need to use the History API programmatically. You could:

This would essentially be a custom script to loop through documents and restore them individually. Not ideal, but it's the available path.

Prevention tip: For future peace of mind, consider exporting dataset backups regularly using the sanity dataset export CLI command. That way you have a safety net outside of the built-in history retention!

Show original thread
6 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions