Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.
There are many reasons you might want to go with stock Android. Selling it or making a warranty claim are among the most important. But you also need to do it if you want to install an over-the-air system update. Or perhaps you’ve installed so many tweaks and mods that you just want to get back to some semblance of normality.
A factory reset won’t help. Any changes you’ve made to the system — such as flashing a custom ROM or installing Xposed modules — can only be undone by making further changes to the system.
In this guide, we’ll take a look at the three main ways to get back to stock. Whether that means going fully unrooted with a locked bootloader or just reverting to the stock ROM but keeping root access, you’ll find an option that works for you.
A Nandroid Backup
The quickest way to revert your phone back to its stock ROM is to restore your Nandroid backup. Assuming you have an up-to-date one available it shouldn’t result in much — or any — data loss.
A Nandroid backup is a full system backup created in the recovery. You should create one every time you flash a new ROM or install any kind of mod. It’s the first tool you should use if you ever brick your phone.
A Nandroid backup creates a complete snapshot of your phone: the operating system, apps, data, and everything else. Restoring it, therefore, restores the ROM you were using at the time. If you have a backup you took when using the stock ROM, then you’re set.
That said, using a Nandroid backup to return to stock is only a short-term option. The backup will restore your old apps and data, meaning that apps you’ve uninstalled will reappear, and text messages you’ve since received will disappear. If your Nandroid is more than a day or two old, you might want to keep it for emergencies only.
How to Restore a Nandroid Backup
Thankfully, the steps to restoring a Nandroid backup are relatively straightforward.
- Boot your phone into your custom recovery. We recommend TWRP.
- Select Restore. You’ll see a list of all the available backups.
- Pick a backup made using the stock ROM.
- Select the partitions you want to restore. Normally this means you should check all the boxes.
- Finally, swipe the bar labelled Swipe to Restore. It takes a few minutes to complete, then you can reboot.
That gets you back to your stock ROM. To go the whole way, open the SuperSU app on your phone and go to the Settings tab. Select Full Unroot then reboot your phone again. It will now be unrooted.
Finally, you might want to relock your bootloader as well. How you do this can vary between devices. The most common method is to use Fastboot with the command fastboot oem lock or fastboot flashing lock. Re-locking the bootloader wipes your device entirely. You should only do it if you absolutely need to, like if you’re sending your phone for a warranty repair or are selling it.
Flash a Stock ROM
If restoring a Nandroid backup isn’t a viable option, then the next best bet is to flash a stock ROM. This comes with the added inconvenience that you will probably need to perform a factory reset along the way, so will need to go through the process of backing up and restoring your data.
There are benefits, too. You might be able to find a version of the ROM that is pre-rooted. Flashing ROMs is also really easy to do.
The biggest obstacle to using a ROM to revert to stock is that you’re relying on someone else to create the ROM for you. If you have a popular phone with an active community on the XDA Developers forums, then this isn’t a problem. If you own a more obscure device, a stock ROM may be harder to find.
The exception is if you own a OnePlus device. In this case you can download a flashable stock ROM direct from the OnePlus website.
How to Flash a Stock ROM
Our guide to installing a custom ROM gives you all info you need. For a quick refresher, here are the steps:
- Find a stock ROM for your phone. Go to forum.xda-developers.com and locate the forum for your device. Stock ROMs are often found in stickied posts at the top of the development boards.
- Download the ROM to your phone.
- Backup all your data.
- Boot into recovery.
- Select Wipe to reset your phone. This is optional (if you don’t want to bother with backing up and restoring), but you may encounter bugs or even get stuck in a bootloop if you don’t do it. Swipe the bar to begin the wipe.
- From the recovery home screen, select Install and navigate your way to the stock ROM you downloaded.
- Swipe the bar to begin installation. You can reboot your phone when it’s finished.
If you downloaded a pre-rooted stock ROM and want to keep it that way, you’re now good to go. If you used a non-rooted ROM and want to get back fully to stock, all you need to do now is relock the bootloader. Remember, this will wipe your phone.
Flash a Factory Image
The ultimate method for getting your phone back to stock is to flash a factory image. This reverts your phone almost to the state it was in when you first unboxed it. All you need to do afterwards is lock the bootloader, and your device will be completely factory fresh.
Factory images come directly from the device manufacturers, and most don’t release them. Google, HTC, and Motorola are among the major companies that do, along with some enthusiast focused brands like Nextbit. It’s normally possible to get factory images from Samsung and LG, but you need to download them from third-party sites.
And where they are available, they’re also more difficult to install than either of the other methods we’ve outlined. Some require a manual approach using the ADB and Fastboot tools with the command line. Some, like Samsung or HTC, use their own software.
Despite the obstacles, flashing a factory image is the best option if you ever need to completely reset your device. It can also serve as the nuclear option if you’ve bricked your device and no other methods to fix it are working.
How to Flash a Factory Image
The procedure to flash a factory image can differ from one device to another. In the case of a Pixel, the steps are simple:
- Download and setup the ADB and Fastboot tools.
- Download the factory image from the Android website. Unzip the download on your desktop.
- Connect your phone via USB and boot into Fastboot mode.
- Launch the command line or terminal app.
- At the command prompt run flash-all.bat on Windows, or flash-all.sh on Mac or Linux.
- Wait for it to finish, then reboot.
That will take you to a stock, unrooted ROM, with stock recovery as well. Lock the bootloader, and you’ll be completely back to normal.
Other phones might have different instructions. You’ll usually find them outlined on the same site where you downloaded the images from. Just remember that in most cases, flashing a factory image will completely wipe your phone.
Did You Get Back to Stock?
Getting back to stock uses the same technqiues used to install ROMs and mods in the first place. If you’re accustomed to working with a rooted phone, there should be nothing in this guide that’s peculiar or alarming. Once you’ve downloaded the original software or found an appropriate backup of your own, the process should take no more than a few minutes.