If you have rooted your 3rd Gen Moto G (2015) and later decided to unroot it, the simplest and foolproof method is restoring stock firmware on it, though various methods are available. To restore a stock firmware, you can either use your Nadroid backup or download ROM from specified sources. The stock ROM will remove any root traces from your Moto G 2015.
Unrooting 3rd Gen Moto G (2015) and restoring stock firmware on it will remove all tweaks and changes you have made on your phone. However, the process will also erase all data from your phone, so make a backup of any data on your phone before proceeding.
1. Motorola drivers installed on your PC. If not, download [HERE] and install it.
2. Download Fastboot zip file [HERE] for Moto G 2015
3. Download stock ROM for Moto G 3 [HERE] (download right ROM for your Moto G 2015 variant XT1540/ XT1541/ XT1542/ XT1543/ XT1544/ XT1548/ XT1550)
Disclaimer: Please follow this guide at your own risk. We can’t take responsibility for anything that goes wrong. This guide is intended for technically talented users only
1. Unzip the downloaded ROM zip file and Fastboot zip file. Copy unzipped ROM files and fastboot.exe file and paste them inside the ADB installation folder.
2. Enable USB debugging mode on your phone from developer option. To do so, got to Settings -> About Phone and tap 7 times on the build number to get developer option.
3. Now, turn off your phone and boot into Fastboot mode. To do so, hold down Volume Down and Power buttons together for few seconds
4. Once entered into Fastboot mode, connect your phone to your PC using a USB cable.
5. Go to ADB installation folder and open a Command Prompt Window by holding down Shift and right clicking anywhere and selecting Open command window here.
6. Issue the below command into the Command Prompt Window:
7. You should see your device listed on the screen.
8. Now, issue the following commands one by one (make sure you get an OKAY message after each command)
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
9. Once you issue the last command, your device should reboot in normal mode. That’s all.
Your 3rd Gen Moto G (2015) is now unrooted and is running the stock ROM. (Source – XDA)