Skip to content

How to undo a Salesforce data load

Short answer: Salesforce has no undo for a data load. Created records can be deleted by ID, deleted records can be restored from the Recycle Bin for 15 days, but updated records only come back if you exported them before the load. Salesforce's own Data Loader guide says to keep that backup file for exactly this reason.

1. Find what the load changed

Data Loader and dataloader.io write a success file after every load. It has the record ID of every row that went through. Keep it: it's the only list of what the load touched. The Data Import Wizard's results are under Setup → Bulk Data Load Jobs.

2. Remove records the load created

Filter the success file to the created rows, keep the Id column, and run a Delete with Data Loader. For smaller numbers, Mass Delete Records in Setup works for accounts, contacts, leads and a few other objects. Deleted records go to the Recycle Bin, so check them before emptying it.

3. Restore records the load updated

This is the hard one. If you exported the records before the load, load that export back as an Update matched on Id, with only the columns the load changed. Without an export, your options shrink:

  • Field history, for fields you track (up to 20 per object), shows old values you can rebuild a file from.
  • A backup product, if your org has one, can restore records to a point in time.
  • Otherwise the old values are gone, and the fix is manual.

Remember that flows, triggers and workflow rules ran on the original load and will run again on the restore. Emails they sent can't be unsent.

4. Bring back records the load deleted

Open the Recycle Bin and undelete them within 15 days. After a hard delete, or once the Recycle Bin is emptied, records can only come back from a backup.

How Dataship does it

Dataship takes the backup for you. Before an update, upsert or delete, it saves the current values of every field the load will change. Undo puts those values back and deletes the records the load created, in one click, and shows you what it restored. You also see which rows will create and which will update before the load runs, so most mistakes never happen.

Flows and triggers still run on an undo, and side effects like sent emails aren't reversed.

Start free