How to Enable Versioning and Restore Files in SharePoint and One Drive
SharePoint and OneDrive make collaboration so much easier and allows users to work on documents and spreadsheets at the same time. We also have the ability to share documents with partners and vendors outside our organization and collaborate with them. But there are many times when users make undesired changes to a document or they accidentally delete a file.
In this post, I will explain some of the ways you can use versioning to quickly restore files to a previous version and also recover any deleted files. Some of these features like versioning has been there a long time, whereas features like Files Restore was launched very recently.
Versioning is a powerful feature available out of the box in SharePoint and One Drive for Business. It protects against undesired edits and allows users to track the history of versions, view and restore previous file versions.
Versioning is enabled by default in SharePoint Online Document Libraries and One Drive for business. It was not always on by default, but this is a change Microsoft made after hearing feedback from the community. This change only applies to sites created after January 2017. Versioning is not enabled by default on SharePoint lists and must be enabled manually.
To enable versioning on a document library, select the settings gear icon and select Library Settings.
To enable versioning on a list, Click the Settings gear icon and select List Settings.
Select Versioning Settings under General Settings
Select Yes for the option ‘Create a version each time you edit a file in this document library?’
You can also limit the number of versions to retain by selecting the box Keep the following number of versions:
Enter the number of versions you would like to retain. SharePoint will only store the number of documents you specify and will remove any versions older than that. Click Ok to save your changes.
There is an option to use both major and minor versions of your document. Some organizations use minor versions when files are under development and major versions when documents are ready to be shared throughout the organization. In many cases, selecting create major version should be sufficient.
View, Restore or Delete Versions
Navigate to the list or library and select the document you would like to view versions for. Select the ellipses next to the item and select version history.
Hover over the date and select the arrow next to it to display the menu. In the menu, you will see three options.
- View the current document. This option allows you to view the current document. It will bring up a dialog box where you can edit, restore, or delete the version.
- Restore the document. This option allows you to restore the version and makes it the current version.
- Delete the document. This option deletes the document and sends it to the Recycle Bin.
- Reject this version. This option allows you to reject the version and shows up on approved documents only.
We have to keep in mind that versioning does not protect against accidental deletes and only allows users to restore a previous version of an existing file.
Restore Deleted Files
When a user deletes a file from SharePoint Online, the file goes to the site recycle bin or the first-stage recycle bin. A user can recover files that was deleted by that specific user only.
How a user can recover delete items Recycle Bin
Open the SharePoint site. Click Recycle Bin. This is the site recycle bin or first stage recycle bin.
Select the Item to restore and click Restore. The file will be restored to its original location.
You can also sort by Date Deleted and Original location to help you find the file you want to restore.
You can also select a file and delete a file from the recycle bin. When a file is deleted from here, it goes to the site collection recycle bin or the second-stage recycle bin. Only a site collection admin can recover the file, once it goes to the site collection recycle bin.
How a site collection admin can restore deleted items.
If you have the classic experience, you can navigate to the site collection admin.
Click the Settings Menu in the top right corner and select Site Settings.
If you use the modern experience, you can get to the site settings by appending the following to your site url.
Under Site collection Administration, select Recycle Bin. Here you will see the same view as the user, but you can see all deleted items in the site collection. The site collection can delete or restore files back to the original location. Any files deleted from the second stage recycle bin are deleted permanently and cannot be recovered.
How long are deleted items kept in the Recycle Bin
Unfortunately, SharePoint Online has a limit on how long it retains deleted files. A file deleted from its original location in SharePoint will only be retained for 93 days in the recycle bin (combined limit for both first-stage and second-stage recycle bin).
A site collection admin can also manually delete files from the site collection recycle bin, after which those files cannot be recovered.
How to recover deleted items from One Drive
Click the Recycle Bin in the left navigation of your One Drive.
Select the file or files you want to restore and click Restore.
In One Drive, files are deleted from the recycle bin after 30 days.
How to restore Files using the New Files Restore feature in One Drive.
Files Restore is a new feature that allows admins and users to restore files to any point in time in the last 30 days. This helps restore files that may have been accidentally deleted or infected by malware. The Files Restore feature allows users to restore their One Drive to a prior point in time before any file corruption or malware infection.
Select Settings and then choose Restore OneDrive.
You can select the histogram slider to go back to a point in time. Select the file or files to restore it and all changes after it. Select the Restore button to undo all highlighted changes.
We have covered in this post, how admins can enable versioning and allow users to view and restore a file to a previous version. This can protect against any undesired edits and gives the user the flexibility to the user to restore a file version.
We also saw how users can easily recover deleted files from their recycle bin as long as it has crossed the retention limit. Any files that have been deleted past 93 days cannot be recovered even by a site collection admin.
It is very important that while we promote collaboration within our organization and encourage users to use the document libraries in modern SharePoint and One Drive, we also have to educate them on how to protect their documents against undesired changes and deletions.