How to restore multiple records that are in recycle bin
|Knowledge Article Number||000002845|
It may be necessary to mass restore a large number of records that were incorrectly moved to the recycle bin. Since there is no "restore all" button in recycle bin it may not be scalable to manually undelete the records from the recycle bin.
For API Enabled Orgs (Enterprise Edition and above by default) a potential solution to mass restore records is by leveraging Workbench.
Note: You can add any additional filters of your choice by clicking the green (+) button.
3. Select the Query button and you should see a list of matching results generated on the page.
Note: When pasting into Excel it's recommended to select Match Destination Formatting and carefully review the result to ensure that the data has been pasted properly into individual rows and that each column's values matches the appropriate header. Column A is not necessary and should be deleted if it contains a blank header and the numbering for the record results.
5. Once you've confirmed the data contained in Excel is formatted and correct, select to Save As and in the prompt's Save as type: drop down select CSV (Comma Delimited) (*.csv), where you'd like to save the file, and name it accordingly and Save. The end result should be a .csv file that contains the records you'd like to restore including their Salesforce Ids.
6. Now back in Workbench, select the data dropdown in the menu options at the top of the page and Undelete. Select From File | Browse... and select your file from step 5 if you used Workbench or the resulting file from Export All if you used Data Loader. The file should contain all of the Ids for the records you'd like to restore | Next. Map the Id field to the ID column in your CSV and select the Map Fields button and lastly the Confirm Undelete button.