Hi Danial,
This can be done by logging into your admin portal then selecting Domains under the Management section. On the Domains Page you will see “Your SharePoint website address is http://www.mydomain.com/ | Change address”Select Change Address and you will see the option to change the domain back to the original domain name.
But make sure you have registered and verified your mydomain.onmicrosoft.com with office 365. Because the domain mydomain.sharepoint.com belongs to the Office 365 account with domain mydomain.onmicrosoft.com. The prefix of the default public website address cannot be changed directly.
Best Regards,
Pratik Pandya