If you accidentally delete a file or folder in OneDrive, you may be able to recover it later from the OneDrive recycle bin. If you need to restore a SharePoint file or folder, see how to restore items from the SharePoint recycle bin.
Here is a step-by-step guide: https://support.office.com/en-us/article/restore-deleted-files-or-folders-in-onedrive-949ada80-0026-4db3-a953-c99083e6a84f