If the user was deleted within 30 days, you can restore the user and all their data from the Microsoft 365 admin center. To learn how, please see "Restore a user in Microsoft 365".
- In the admin center, go to the Users > Deleted users page.
- On the Deleted users page, select the name of the user who you want to restore, and then select Restore user. You can select multiple users if you want to restore more than one deleted account.
- Follow the prompts to set their password, and then select Restore.
To preserve a former user's OneDrive files, first give yourself access to their OneDrive, and then move the files you want to keep. The reference: "Access a former user's OneDrive documents".
- In the admin center, go to the Users > Active users page.
- Select a user.
- On the user properties page, select OneDrive. Under Get access to files, select Create link to files.
- Select the link to open the file location. Download the files to your computer, or select Move to or Copy to to move or copy them to your own OneDrive or to a shared library.
If you deleted the user more than 30 days ago, the user will no longer appear in the Microsoft 365 admin center, and you'll need to use PowerShell to restore the OneDrive. For more, you may checkout: "Restoring a deleted OneDrive site".
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.