Restore a shared library
If lots of your SharePoint or Microsoft Teams files get deleted, overwritten, corrupted, or infected by malware, you can restore an entire shared document library to a previous time. The restore will undo all the actions that occurred on both files and folders in the last 30 days.
If your entire library was deleted, see Restore items in the Recycle Bin of a SharePoint site. If you want to correct issues with individual files one at a time, you can restore deleted items or restore a previous version of an item. For files in OneDrive, you can restore your OneDrive.
Restore the library to a previous time
-
Go to the SharePoint document library you'd like to restore. (In Microsoft Teams, from the Files tab at the top of your channel, select More > Open in SharePoint.)
-
Select Settings
> Restore this library.Note: If you don't see Restore this library under Settings, you either don't have permission or you're looking at a classic library.
-
On the Restore page, select a date from the dropdown list, such as Yesterday, or select Custom date and time.
-
Use the activity chart and activity feed to review the recent activities that you want to undo.
The daily activity chart shows the volume of file activities in each day for the last 30 days. It gives you an overview of what has happened to your library over time and can help you identify any unusual activities, such as when your files were infected by malware.
The activity feed shows individual file and folder operations in reverse chronological order. You can scroll down to see previous days, or move the slider below the daily activity chart to quickly move to a specific day.
-
If you're selecting a custom date and time, select the earliest activity that you want to undo. When you select an activity, all other activities that occurred after that are selected automatically.
-
When you’re ready to restore your library, select Restore to undo all the activities you selected.
Your library will be restored to the state it was in before the first activity you selected. If you change your mind about the restore you just did, you can select Restore this library to undo the restore by selecting the restore action you just did.
Limitations and troubleshooting
-
Only site admins can start a restore. Anyone visiting the library will see a notice while the restore is in progress.
-
Restoring files uses version history and the recycle bin. When version history is turned off, you won’t be able to restore files to a previous version. For information about versioning settings, see Enable and configure versioning for a list or library.
-
Deleted files can’t be restored after they’ve been removed from the site collection recycle bin—either by manual delete or by emptying the recycle bin.
-
If you upload a file or folder again after deleting it, the restore operation for that file or folder will be skipped.
-
If some files or folders cannot be restored, a log file will be generated to capture the errors. The name of the file begins with "RestoreLog" followed by an ID (for example, RestoreLog-e8b977ee-e059-454d-8117-569b380eed67.log). You can share the log file with our support team to troubleshoot any issues that may occur.
-
Restore this library is available for the modern experience in SharePoint only and can't be used to restore an entire library that's been deleted. If your entire library was deleted, see Restore items in the Recycle Bin of a SharePoint site.