You may never need to restore your OneDrive, but if lots of your files get deleted, overwritten, or infected by malware, you can restore your entire OneDrive to a previous time.
Go to the OneDrive website.
At the top of the page, select Settings > Restore your OneDrive from the left navigation.
On the Restore page, select a date from the dropdown list or select Custom date and time.
Use the activity chart and activity feed to review the recent activities that you want to undo.
Note: The Restore your OneDrive option isn't available in the classic experience of OneDrive for Business or without a Microsoft 365 subscription.
Restore your OneDrive article