# How to restore a SharePoint document library Last updated on: 18th March, 2026 A [SharePoint document library](https://www.manageengine.com/sharepoint-management-reporting/kb/how-to-create-document-library-in-sharepoint.html) may need to be restored due to accidental deletion, unwanted modifications, or ransomware impact. Depending on the scenario, restoration can mean reverting the library to a previous version, recovering it from the Recycle Bin, or [restoring it from a backup](https://www.manageengine.com/sharepoint-management-reporting/kb/how-to-backup-sharepoint-document-library.html). This guide walks you through each restoration scenario with different solution methods so you can choose one that best suits your organization's needs. ## Scenario 1: Restore a document library to a previous version SharePoint allows you to restore a document library to a previous point in time through versioning. If your library still exists but its contents, structure, or settings have been modified, you can revert it to an earlier state. This is essentially an undo button for your document library. ### Prerequisites - You must be a *Site Owner or have Full Control* permissions on the document library. - Ensure version history is enabled (**Library settings > Versioning settings**). ### Steps 1. Navigate to the SharePoint site. 2. Open the document library. 3. Click the **Settings icon ⚙** and select **Restore this library**. ![Navigating to the Restore this library option in SharePoint Online.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/restore-this-library-option.png) 4. On the *Restore* page, choose a preset time (like **Yesterday**) or select **Custom date and time** to pick a specific point. ![Restoring a SharePoint document library to a previous version in SharePoint Online.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/restore-previous-document-library-version.png) 5. Use the activity chart and activity feed to review recent activities and find the exact restore point you want. ![Reviewing recent activities in a SharePoint document library](https://www.manageengine.com/sharepoint-management-reporting/kb/images/review-recent-document-library-actions.png) 6. Once you’ve selected the correct date and time, click **Restore** to begin the process. 7. Confirm the action when the warning appears. The library will revert to its previous state, including files and metadata as of the selected date. ## Scenario 2: Restore individual files to a previous version You can revert a SharePoint file to a previous version without affecting the whole document library using the browser UI or PowerShell. ### Steps to restore using the SharePoint Online browser UI #### Prerequisites - Ensure version history is enabled (**Library settings > Versioning settings**). - You must have *Edit, Contribute,* or higher permissions. #### Steps 1. Open the document library and locate the file you want to restore. 2. Click the **three dots (…)** next to the file name and select **Version history**. ![Navigating to Version history in SharePoint Online](https://www.manageengine.com/sharepoint-management-reporting/kb/images/sharepoint-file-version-history.png) 3. Review the list of previous versions. 4. Click the **drop-down arrow** next to the version you want. 5. Select **Restore**. ![Restoring a file to a previous version in SharePoint Online.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/restoring-previous-sharepoint-file-version.png) ### Steps to restore using PowerShell #### Prerequisites 1. Before using PowerShell, ensure that: - You have *SharePoint Administrator* or *Global Administrator* rights. - The *PnP.PowerShell* module is installed. 2. Install and connect to the specific site where the file is: ```powershell Install-Module PnP.PowerShell -Scope CurrentUser Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/ProjectSite" -Interactive ``` #### Restore a specific version Run this script to restore a specific version using the *Restore-PnPFileVersion* cmdlet: ```powershell Restore-PnPFileVersion -Url "Shared Documents/MyFile.docx" -Identity "1.0" -Force ``` #### Restore the immediate previous version If you need to quickly revert to the version just before the current one: ```powershell # 1. Target the file $file = Get-PnPFile -Url "Shared Documents/MyFile.docx" -AsListItem $fileObject = $file.File # 2. Load the versions into memory Get-PnPProperty -ClientObject $fileObject -Property Versions | Out-Null # 3. Logic to restore the most recent backup if ($fileObject.Versions.Count -gt 0) { $previousVersion = $fileObject.Versions[$fileObject.Versions.Count - 1] $fileObject.Versions.RestoreByLabel($previousVersion.VersionLabel) Invoke-PnPQuery Write-Host "Success! Restored to version: $($previousVersion.VersionLabel)" -ForegroundColor Green } else { Write-Warning "No previous versions found to restore." } ``` ### Limitations of using native solutions - Restore points are limited to a defined retention window. - Recent changes after the restore point will be overwritten. - PowerShell cannot restore an entire document library in a single operation; items must be restored individually. - This method requires specific admin roles and familiarity with the interface. ## Scenario 3: Restore a deleted document library from the Recycle Bin When a file, folder, or [document library is deleted](https://www.manageengine.com/sharepoint-management-reporting/kb/how-to-delete-document-library-in-sharepoint.html), it is automatically moved to the site Recycle Bin. ### Steps to restore using the SharePoint Online browser UI 1. Go to the SharePoint site. 2. Click the **Settings icon ⚙** and select **Site contents**. 3. Select **Recycle bin**. ![Navigating to Site contents in SharePoint Online to restore a document library.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/restore-library-from-site-contents.png) 4. Locate the deleted object, select it, and click **Restore**. ![Restoring a document library from the Recycle Bin in SharePoint Online.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/restore-sharepoint-document-library.png) ### Steps to access the second-stage Recycle Bin in SharePoint Online If the library is not visible in the site Recycle Bin, it may have been moved to the second-stage Recycle Bin (Site Collection Recycle Bin). 1. At the bottom of the Recycle Bin page, click **Second-stage recycle bin**. ![Accessing the second-stage Recycle Bin in SharePoint Online.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/second-stage-recycle-bin.png) 2. Locate the deleted document library. 3. Select the item and click **Restore**. ### Steps to restore using PowerShell #### Prerequisites - You have SharePoint Administrator or Global Administrator rights. - The PnP.PowerShell module is installed: ```powershell Install-Module PnP.PowerShell -Scope CurrentUser ``` #### Steps 1. Connect to the specific site collection: ```powershell Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/ProjectSite" -Interactive ``` 2. Restore the deleted document library: ```powershell Get-PnPRecycleBinItem | Where-Object { $_.Title -like "*Project Documents*" } | Restore-PnPRecycleBinItem -Force ``` ### Limitations of using native solutions - Items are retained for up to 93 days from the original deletion date. - Once permanently deleted, Recycle Bin restore is not possible without backups. - This method requires high-level permissions and scripting knowledge. ## Scenario 4: Restore a document library from a backup If the library was permanently deleted or corrupted beyond Recycle Bin recovery, restoration must be performed from a backup. Third-party tools like SharePoint Manager Plus support [full-site backups and restoration](https://www.manageengine.com/sharepoint-management-reporting/tool-to-automate-sharepoint-backup.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library). 1. In SharePoint Manager Plus, navigate to **Backup > Backup Restore**. 2. Click **Explore Backup** on the backup that contains the document library. ![Navigating to restore a SharePoint backup in SharePoint Manager Plus.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/explore-backup-sharePoint-manager-plus.png) 3. In the *Select Objects* pop-up, select the site that contains the document library. ![Restoring a SharePoint backup using SharePoint Manager Plus.](https://www.manageengine.com/sharepoint-management-reporting/kb/images/restoring-backup-using-sharePoint-manager-plus.png) 4. Click **Restore**. You can check the status by clicking **Restore History**. ## Streamline document library management with SharePoint Manager Plus Managing document libraries in SharePoint often requires navigating multiple admin centers, running PowerShell scripts, or manually reviewing settings. SharePoint Manager Plus provides a centralized, web-based console to streamline document library management. ### Automate SharePoint backup Secure document libraries by [scheduling backups](https://www.manageengine.com/sharepoint-management-reporting/tool-to-automate-sharepoint-backup.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library) of individual sites or entire site collections. Restore them at any time to a previous state to quickly recover from disasters and ensure business continuity. ### Audit document library changes Track who created, modified, deleted, or accessed files and document libraries. [Detailed audit logs](https://www.manageengine.com/sharepoint-management-reporting/sharepoint-file-auditing-monitoring-tool.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library) help you monitor suspicious activity, investigate incidents, and prepare for compliance checks. ### Manage permissions and inheritance [Control document library access](https://www.manageengine.com/sharepoint-management-reporting/sharepoint-permission-management-tool.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library#granular_permission_management) at scale or granularly. Identify broken inheritance, remove excessive permissions, and enforce consistent access controls. ### Generate detailed reports [Schedule comprehensive reports](https://www.manageengine.com/sharepoint-management-reporting/sharepoint-permission-reporting-tool.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library#folder-file-permissions) on document library permissions, activity, storage usage, and more. Export reports in formats such as CSV, PDF, XLSX, and HTML. ### Role-based delegation Easily [delegate reporting and management tasks](https://www.manageengine.com/sharepoint-management-reporting/sharepoint-helpdesk-delegation-tool.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library) on document libraries and other SharePoint files to non-IT users and help desk staff. ## Important tips Follow these best practices to ensure safe restoration and avoid data loss: ### Understand restore limitations Native SharePoint Online restore operations are bound by a 93-day retention period. Once content is permanently deleted from both Recycle Bins after this period, it cannot be recovered without a backup. ### Verify restore location Ensure the restore location does not conflict with an existing library of the same name. Name conflicts may require manual resolution. ### Check permissions and site owner access After restoring a document library, verify that permissions and site owner settings are intact. Broken inheritance may require manual review. https://www.manageengine.com/sharepoint-management-reporting/sharepoint-permission-reporting-tool.html?utm_source=spmp-kb&utm_medium=how-to-restore-sharepoint-document-library ### Review Microsoft Teams impact Files shared in Microsoft Teams channels are stored in associated SharePoint document libraries. Restoring or modifying these libraries can impact Teams collaboration. ## FAQ ### 1. How do I undo in SharePoint? There isn’t a single universal undo button in SharePoint, but you can reverse actions using the options below: - **Undo file changes (version history)** Open the document library > click the three dots (…) next to the file > select **Version history** > choose a previous version > click **Restore**. - **Undo deleted files (Recycle Bin)** Go to **Site contents** > select **Recycle bin** > choose the deleted item > click **Restore**. - **Undo large library changes (restore the library)** Open the document library > click the **Settings icon ⚙** > select **Restore this library** > choose a date and restore the entire library. The method you use depends on whether you're undoing a file edit, a deletion, or broader library changes. ### 2. Where is the Recycle Bin in SharePoint? In SharePoint Online, the Recycle Bin can be accessed from the Site contents page. Go to **Settings > Site contents** and click **Recycle Bin** at the top-right corner. Site owners and administrators can also access the second-stage Recycle Bin from within the Recycle Bin page. ### 3. How does the SharePoint Online Recycle Bin restore process work? When a file, folder, or document library is deleted, it moves to the first-stage Recycle Bin. If deleted again, it moves to the second-stage Recycle Bin. You have 93 days from the original deletion date to restore it. When you perform a restore operation: - The item returns to its original location. - Folder structures are automatically recreated if needed. - Document libraries are restored with files, folders, metadata, permissions, and version history intact. If the entire document library was deleted, it must be restored first before restoring individual files inside it. ### 4. How long do you have to recover files from your SharePoint Recycle Bin? In SharePoint Online, you have up to 93 days to recover deleted files, folders, document libraries, and other content from the Recycle Bin. Retention policies or legal holds may override standard deletion behavior. ### 5. How do I see version history in SharePoint? To view version history for a file in SharePoint: 1. Go to your **SharePoint site** and open the document library. 2. Locate the file and click the three dots (…) next to the file name. 3. Select **Version history**. You’ll see a list of previous file versions, including who modified them and when. From there, you can view, restore, or delete specific versions depending on your permissions.