Your input shapes our product. Suggest a feature now →
  1. Home
  2. Guides
  3. Restore a document library

How to restore a SharePoint document library

"Restore the library" means three different things in SharePoint depending on what went wrong, and picking the wrong one wastes the window you have. Work out which situation you are in first.

What happened What to use Time limit
Lots of files changed, overwritten, or deleted at once. Ransomware, a bad sync, a script that ran twice. Restore this library 30 days
Specific files, folders or list items were deleted. Recycle bin, first then second stage 93 days total
One file was overwritten with a bad version. Version history on that file As far back as versions are kept
The entire library was deleted. Recycle bin - the library is an item like any other 93 days total

Restore this library: the 30-day undo

This is the one most people mean and the one most people cannot find. It rolls the whole library back to a point in time, undoing file and folder activity rather than recovering individual deleted items.

  1. Open the document library.
  2. Select Settings, then Restore this library.
  3. Use the daily activity chart to find the damage. It shows the volume of file activity for each of the last 30 days, which is usually enough to spot the day a sync went wrong or a script ran twice.
  4. Select the earliest activity you want to undo. Everything after that point is selected automatically, so you are choosing a point in time rather than picking individual actions.
  5. Confirm the restore.
Not seeing the option? Microsoft gives two reasons: you do not have permission, or you are looking at a classic library. It sits under the library's Settings menu, not site settings, which is where most people look first. See Microsoft's Restore a shared library for the current interface.

30 days and 93 days are not the same window

This is the trap. Restore this library covers 30 days of activity. The recycle bin keeps deleted items for 93 days. They are separate features with separate limits, and the difference decides whether your content is recoverable.

If a mass deletion happened 40 days ago, Restore this library will not reach it, but the deleted items are still sitting in the recycle bin with about seven weeks left on the clock. People who only know about the 30-day rollback assume the content is gone. It usually is not.

The 93 days is a total counted from the moment of deletion, and it keeps running while the item sits in the second-stage bin. Emptying the first-stage bin does not reset or extend it.

When the library itself was deleted

Restore this library cannot help, because there is no library left to roll back. A deleted library behaves like any other deleted item: it goes to the site recycle bin, and restoring it brings back the library and its contents together.

If somebody has already emptied the first-stage bin, it is not gone. It has moved to the second-stage bin, which only a site collection administrator can open. This is the single most common reason a user reports a library as permanently lost when it is still perfectly recoverable one level up.

When you are restoring across many sites

Restore this library works on one library at a time, through the browser. That is fine for an incident on one site. It is painful when you are working through a tenant after an offboarding, a bad sync, or a script that touched several sites at once, because you have no way to search the bins or to see which sites are affected.

That is the job Recycle Master does: it reads the recycle bin for a site collection, first stage and second stage, and lets you filter by name, original location, item type, who deleted it, and a date range, then restore the matches together with a choice of what happens when a file already exists. Restoring needs a Recycle Master licence; on the free trial you can search the bin and see exactly what is recoverable without being able to restore it.

Frequently asked questions

How do I restore a SharePoint document library?
It depends on what went wrong. If files inside the library were mass-edited, overwritten or deleted within the last 30 days, use Settings then Restore this library, which undoes file and folder activity back to a point you choose. If specific items were deleted, use the recycle bin, which holds them for 93 days. If a single file was overwritten, use that file's version history instead.
How far back can Restore this library go?
30 days. Microsoft's documentation states the restore undoes all the actions that occurred on files and folders in the last 30 days. That is a different and shorter window than the recycle bin's 93 days, which is the main reason people think their content is unrecoverable when it is not, or the reverse.
Why can I not see Restore this library?
Two common reasons, per Microsoft: you do not have permission, or you are looking at a classic library. The option lives under the library's Settings menu, not the site settings.
Can I restore a document library that was deleted entirely?
Restore this library cannot help there, because the library itself is gone rather than damaged. A deleted library goes to the site's recycle bin like any other item and can be restored from there within the 93-day window. If it has already been emptied from the first stage, a site collection administrator can recover it from the second-stage bin.
Does restoring a library use up storage?
Restoring items out of the recycle bin returns them to the library, so the storage they occupy moves from the bin back to live content rather than being added. Items sitting in either recycle bin already count against the site collection's storage quota for the whole retention period.

Related reading