1.If an active directory account is accidentally deleted first thing to do is check if the Active Directory recycle bin is enabled.
2.If the Recycle bin would show as an OU in the root of the domain in the Active Directory Administrative Center.
3.In that OU you should see the deleted user account be able to restore it using right click and restore.
4.If that works, the user will resync with Office365 then from the admin portal you can recover the deleted account under Users -> Deleted Users
5.Click on the user then select Restore
6.Follow the prompts to set the password. ( this won’t really matter as we will be syncing it with an active directory account. )
7.Wait for the account to restore (depending on the account size can take 15 to 45 minutes)