In this tutorial, we show you how to restore original stock firmware on Moto G4/G4 Plus/G4 Play as well as lock the bootloader in case you have already unlocked it. However, note that there is no guarantee that the process will revert back your Moto G4 to factory state for warranty purpose.

The below tutorial assume that you have knowledge on ADB, Fastboot, and how to issue fastboot commands. If you have followed the guide carefully, you can unroot or restore stock firmware on your Moto G4.

How to Reinstall Official Firmware on Moto G4, G4 Plus and G4 Play

Prerequisites: a) Download and install Motorola USB Drivers on your computer (download) b) ADB and Fastboot setup on your computer (guide) c) Enable USB Debugging. To do so, go to Settings -> About and tap Build version 7 times. It will unlock the Developer options. Then, go to Settings -> Developer options and enable USB Debugging. Instruction to Restore Stock Firmware

  1. Download the correct firmware for your device from here (confirm your device model number before downloading the firmware)
  2. Extract the downloaded firmware zip file and save all the contents into the ADB installation folder.
  3. Reboot your Moto G4 into the Bootloader Mode. To do so, turn off your phone and then press and hold the Volume Down & Power buttons simultaneously for a few seconds.
  4. Connect your phone to your PC via USB cable.
  5. Now, launch a command window from inside the ADB folder (where firmware files are saved). To do, click shift key, right click and select open command window here option).
  6. In the command window, issue the following commands one by one: mfastboot oem fb_mode_set mfastboot flash partition gpt.bin mfastboot flash bootloader bootloader.img mfastboot flash logo logo.bin mfastboot flash boot boot.img mfastboot flash recovery recovery.img mfastboot flash dsp adspso.bin mfastboot flash oem oem.img mfastboot flash system system.img_sparsechunk.0 mfastboot flash system system.img_sparsechunk.1 mfastboot flash system system.img_sparsechunk.2 mfastboot flash system system.img_sparsechunk.3 mfastboot flash system system.img_sparsechunk.4 mfastboot flash system system.img_sparsechunk.5 mfastboot flash system system.img_sparsechunk.6 mfastboot flash system system.img_sparsechunk.7 mfastboot flash modem NON-HLOS.bin mfastboot erase modemst1 mfastboot erase modemst2 mfastboot flash fsg fsg.mbn mfastboot erase cache mfastboot erase userdata mfastboot erase customize mfastboot erase clogo mfastboot oem fb_mode_clear
  7. And, finally, reboot your device by issuing the below command: mfastboot reboot Your Moto G4 will reboot now. If you have unlocked Bootloader warning, then do the following:
  8. Download the logo.img file from here, unzip it and move the content into ADB installation folder.
  9. From ADB, open a command prompt and issue the following commands one by one: mfastboot flash logo logo.bin mfastboot reboot Troubleshooting: If your phone stuck at boot loop or unable to boot, turn off the device, go to Bootloader mode, launch command window and issue below commands: mfastboot erase cache mfastboot erase userdata mfastboot reboot It will reboot your phone and you will have the stock firmware back on your phone. Leave your views in the comment section below (source)