Restore a document library

If lots of your SharePoint files get deleted, overwritten, corrupted, or infected by malware, you can restore an entire SharePoint 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.

Note: Some functionality is introduced gradually to organizations that have opted in to the Targeted Release program. This means that you may not yet see this feature or it may look different than what is described in the help articles.

Restore the library

  1. Go to the SharePoint document library you'd like to restore

  2. Select Settings Settings: update your profile, install software and connect it to the cloud > Restore this library

  3. On the Restore page, select a date from the dropdown list, such as Yesterday, or select Custom date and time.

    Figure showing the select a date options

  4. Use the activity chart and activity feed to review the recent activities that you want to undo.

    Figure showing Restore this library date slider

    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.

  5. 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.

  6. 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 owners 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 Online only.

Need more help?

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×