You can simply use autoloader to go back to the official OS. If you are using the Z10 or any other BB 10 devices, turn off your phone and remove the battery first, then run the autoloader and connect your phone. When the autoloader process begins, insert the battery back.
It is recommended to wipe your device using security wipe after you finish the autoloader process.
Remember that using autoloader will delete all of your settings and data stored in the phone memory so make sure you do a backup first. Also, make sure that you download the autoloader made for your phone.