Pre-requisites:
a) Download and install Motorola Drivers:
http://www.mymotocast.com/download/MDM?platform=windows
b) Download and extract the stock firmware of your choosing (Warning: downgrading is untested!) from:
http://sbf.droid-developers.org/phone.php?device=14
Edit:
The firmware files have been updated most of the firmware archives are now in .tar.gz archives which include Motorola fastboot and flashing scripts for OSX, Linux and Windows.
The firmwares with '_umtsds' in the file name are for the 'dual-sim' versions of the Moto G, it's probably not a good idea to flash these onto single sim phones, or vice-versa.
On windows the .tar.gz archives need to be opened and extracted using a 3rd party archive manager. e.g.
7-zip, or
PeaZip, Windows cannot extract these files natively, Linux and OSX can.
I used the retail British firmware (fastboot_falcon_retgb_user_4.3_14.10.0Q3.X-76-LGG-8_54_release-keys-cid7-Retail_GB.tar.gz), extracted to c:\
c) If the firmware file you downloaded is a .xml.zip file then download Motorola Fastboot
View attachment 2427667 (attached to this post) and extract the .exe into the same folder as the stock firmware files (the same folder as the .bin and .img files). If your firmware is a .tar.gz file then skip this step.
d) Get ADB (if you don't already have this, I suggest downloading and installing
Minimal ADB and Fastboot by shimp208:
https://docs.google.com/file/d/0B1S0LCuXCnnmSWh6NGJmSE1BUWc
Disclaimer:
Follow these instructions at your own risk. If something goes wrong don't blame me!
I have only tested this on a Retail Moto G with an unlocked bootloader, however as these are the stock signed image files from Motorola it 'should' work on any device.
Edit: tkm89 reports that he was able to use this guide to restore to Stock Retail British firmware from a bootloader locked Tesco mobile Moto G
Steps to restore stock firmware:
1) Enable developer mode on the Moto G (Settings-> 'About Phone'. Tap 7 times on 'Build Number')
2) Enable USB debugging. (Settings -> 'Developer options' -> 'USB Debugging' ->
check)
3) Connect phone to computer via USB, you should see a new ADB device detected and drivers installed.
4) Reboot to bootloader. Open "Minimal ADB and Fastboot". Type:
You should see the Moto G bootloader screen with the following options:
Code:
Normal Powerup
Recovery
Factory
Switch Console [NULL: null]
Barcodes
BP Tools
5) Open a command prompt / terminal (Start -> cmd.exe in Win7) and browse to the folder with the extracted firmware.
In my case:
Code:
cd C:\falcon_retgb_user_4.3_14.10.0Q3.X-76-LGG-8_54_release-keys-cid7-Retail_GB
6a) If you downloaded and extracted a firmware in .tar.gz format
Run the 'flashall.bat' script in windows or './flashall.sh' in Linux/OSX
6b) If you downloaded and extracted a firmware in .xml.zip format.
Flash each of the partitions in sequence using mfastboot, you need to enter the following commands one-by-one checking that each one returns an [OKAY]
Code:
mfastboot flash partition gpt.bin
mfastboot flash motoboot motoboot.img
mfastboot flash logo logo.bin
mfastboot flash boot boot.img
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk1
mfastboot flash system system.img_sparsechunk2
mfastboot flash system system.img_sparsechunk3
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
mfastboot erase cache
mfastboot erase userdata
mfastboot reboot
7) You should now be rebooted into a fully stock Moto G firmware.