The Custom Droid

Android Tutorials, Tips and Tricks

How to Restore Stock Firmware on Moto G (All Models)

Restore Moto G to stock firmware

Follow this guide to restore stock firmware on Moto G. The instructions will work for Moto G 1st Gen, 2nd Gen, 3rd Gen, 4th Gen, Moto G5/Moto G5 Plus, and Moto G5S/Moto G5S Plus.

Advertisement

The Moto G series is the OEM’s most prominent handsets that do well with the hardware, design, as well as on the software. But if you have accidentally messed up your phone, removed the OS, don’t feel right on custom ROMs, or want to turn in your Moto G smartphone for servicing? Then this guide will assist you on how to restore Moto G stock firmware. The process is easy and only requires you to flash the stock firmware/factory image via fastboot commands.

Restore Stock Firmware on Moto G

Advertisement

Guide to Restore Moto G Stock Firmware

Unlike many other OEMs, Motorola pushes fastboot flashable firmware in form of zips. You can use the image files in the zip and flash them in order to restore stock firmware on Moto G devices. The supported device list includes the following. In simple words, only the following could be restored using this tutorial.

  • Moto G (1st Gen)
  • Moto G (2nd Gen)
  • Moto G (3rd Gen)
  • Moto G4 (4th Gen)
  • Moto G5 and G5 Plus
  • Moto G5S and G5S Plus

All you will need to restore stock firmware on Moto G is the factory image for your model and variant. Be careful while searching for this, flashing the wrong files may permanently damage your phone. The procedure is nearly same for all the devices and could be followed correctly with a little awareness.

Download Moto G Stock Firmware

You can grab the full factory image for your Moto G model and variant directly from www.stockrom.net. Just visit the link and press Ctrl + F on your keyboard. Then search for your device, example – “moto g”.

Prerequisites

Make sure to fulfill all the listed requirements before you go ahead and follow the instructions to restore stock firmware on Moto G.

Restore Stock Firmware on Moto G

  1. Download the factory image corresponding to your Moto G variant and model. Extract the downloaded firmware to the platform-tools folder.
  2. On an empty space inside the folder, press SHIFT key and right-click on an empty space. Select Open PowerShell window here from the pop-up that appears.
    Open PowerShell on Windows
  3. Connect your phone to the PC, and make sure it is unlocked. Enter the following command in the command-line window:
    adb reboot bootloader
  4. Your Moto G smartphone will now enter bootloader mode. This is where we will flash the factory image.
    Restore Stock Firmware on Moto G - Bootloader Mode
  5. Once it has, make sure that fastboot detects your device by entering the following command:
    fastboot devices
  6. The above command will return an output with the device ID. If it doesn’t, make sure that you have installed the drivers and reboot your machine.
    Restore Stock Firmware on Moto G - Fastboot devices command
  7. Enter the following commands now to flash the factory image and restore stock firmware on Moto G device. There may be a chance that your device or variant has an extra or a less number of system.img_sparsechunk file, so make sure to flash accordingly. If you are downgrading your Moto G’s firmware, do not flash gpt.bin and bootloader.img/motoboot.img files.
    fastboot oem fb_mode_set
    
    fastboot flash partition gpt.bin 
    
    fastboot flash bootloader bootloader.img 
    
    fastboot flash logo logo.bin 
    
    fastboot flash boot boot.img 
    
    fastboot flash recovery recovery.img 
    
    fastboot flash system system.img_sparsechunk.0 
    
    fastboot flash system system.img_sparsechunk.1 
    
    fastboot flash system system.img_sparsechunk.2 
    
    fastboot flash system system.img_sparsechunk.3 
    
    fastboot flash system system.img_sparsechunk.4 
    
    fastboot flash system system.img_sparsechunk.5 
    
    fastboot flash modem NON-HLOS.bin 
    
    fastboot erase modemst1
    fastboot erase modemst2 
    
    fastboot flash fsg fsg.mbn 
    
    fastboot erase cache 
    
    fastboot erase userdata 
    
    fastboot erase customize 
    
    fastboot oem fb_mode_clear
  8. Once everything is done, reboot the phone:
    fastboot reboot

Once your device boots, you will see the initial setup instructions. Now, this is how you can restore stock firmware on Moto G and it’s pretty easy for anyone to follow. If you have any queries or feel stuck, let us know via the comments below.

About the Author

Founder and Editor-in-Chief

Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it. He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.

Comments 12 Comments

  1. do not flash gpt.bin and bootloader.img/motoboot.img files. this lines made mt day, thanks brother 🙂

    1. Hi. You’re welcome!

      Those two files hold immense importance. Flashing an older gpt.bin (partition table) or an older motoboot.img (bootloader) can potentially brick the phone, mostly beyond self-recovery. I have gone through this mishap back with Moto E 1st Gen, and it taught me a lesson; to not miss any details when meddling with anything.

      Most novice users nowadays think that processes like rooting, unlocking the bootloader, flashing ROMs, and even restoring stock firmware, is quite easy. However, they forget the details, the processes may vary from manufacturer to manufacturer, sometimes even different between devices from the same manufacturer.

      For anyone else reading this: If you are following any guide on our site, ensure that you thoroughly go through the complete post, without missing even a paragraph before proceeding.

  2. Hi,
    I have a moto G5 S plus which suddenly entered in a boot loop last month.At first I tried to factory reset my phone through boot loader but it didn’t work out.I then unlocked my phone and tried to flash a custom ROM through TWRP.I followed the exact process by wiping the partions and then tried flashing the Rom.I did not take any backup of the files. The flashing didn’t work I repeatedly got the error 7.I Google for solution it asked me to use the latest TWRP software and to delete the asserts.I did exactly what it asked me to do.I still keep getting the same error over and over again.I even tried flashing other ROMs and even stock rom. It won’t work.Can you please tell me why is this happing and I wanna try the above process I understood every step but how would I know how may system.img_sparsechunk files my device has and how may should I write in the command.please help!

  3. Please tell me what to do in order to relpck the bootloader. I unlocked my phone and now i am having some glitches and bugs with power and network. So i would like to relock the bootloader. I know i hv to flash the custom rom but then next what to do?

    Please yell tell me.

    Thanks for your help on this topic. I couldn’t find this anywhere else on the internet.

    1. Hi Ansh. Unlocking the bootloader has nothing to do with the software-related bugs. It’s just like a hardware switch that has no relation with the software’s performance whatsoever.

      As for unlocking the bootloader on Motorola phones, I think it is not possible. Instead of that, I would suggest you take a full backup of all the data including internal storage and then flash the latest stock firmware available for your phone.

      And don’t worry, an unlocked bootloader would not affect your phone’s ability to receive OTA updates in future.

  4. fastboot flash partition gpt.bin
    target reported max download size of 536870912 bytes
    sending ‘partition’ (45 KB)…
    OKAY [ 0.005s]
    writing ‘partition’…
    (bootloader) Validating ‘gpt.default.xml’
    (bootloader) Security version downgrade
    (bootloader) Image primary_gpt failed validation
    (bootloader) Preflash validation failed
    (bootloader) Cancelling ‘gpt.default.xml’
    FAILED (remote failure)
    finished. total time: 0.082s

    1. Please avoid GPT.bin if you’re flashing a lower firmware. It might brick your device beyond recovery.

    2. Bro ihave a moto g xt1033 which is only getting detected in fastboot mode..can see device id in fastboot mode..but not turning on at all…i dont have a unlocked bootloader or usb debugging enabled…how can i flash a fatboot rom..pls reply…

Leave a Reply

Comments are moderated, and published only if they are relevant to the topic and add value in a constructive way. If you disagree with something, please be polite and respectful. We suggest you read our comment policy before commenting.