[Moto G 2015 Q&A, Help & Troubleshooting] arunhebbare:
Dear friend,

You need not have your bootloader unlocked to flash factory firmware

Quote from the XDA forum factory firmware link:

"Frequently Asked Questions:

Can I restore Factory Firmware if my Bootloader is locked?

Yes."

And if you are still stuck with a phone stuck at logo or is looping at the boot, either follow steps given elsewhere in this forum or follow the method that I am enumerating below which is what I would have done (which in principle is same as given elsewhere).

Getting your phone revived is your first priority. Unlocking bootloader and rooting is secondary.

You would be needing a pc with administrator privilege, internet connection and of course your phone along with the usb cable.

You would be needing the drivers for your phone, minimal adb and fastboot files, stock firmware for your phone model. All these files are available in the XDA forum as per links provided by others or as per this link

http://xdaforums.com/2015-moto-g/general/guide-fastboot-flashing-factory-t3187750

1. Correctly install drivers onto your pc using administrator privileges.

2. Unzip and Install the minimal adb and fastboot files onto your pc into some specific directory and click the executable files once. This would ensure that all the files are loaded and dos prompt recognizes the adb and fastboot commands (commands are different for ADB stage and FASTBOOT stage, what you are going to use is directly the fastboot stage commands given below). Install as an administrator. Note this specific directory and file where you unzipped and installed the minimal adb file as you will need it in the below step.

3. Download the stock 6.0.1 mm firmware for XT1550 from the link below store it in you pc.

http://xdaforums.com/2015-moto-g/general/index-moto-g-factory-firmware-images-t3169639

Unzip the stock firmware. Now copy all the files of the stock firmware (all of them) into the specific file of the minimal adb and fastboot which you unzipped into and installed earlier and noted the location. You need to copy all the firmware files into the minimal adb and fastboot directory as that way you avoid specifying the location of the files for each flash command which is both simple and saves us from a lot of mistakes.

4. After copying all the unzipped stock firmware files in the minimal adb fastboot directory, press the shift button on keyboard and right click the mouse on the screen where in a dialogue box appears and choose to open the command prompt in this directory. This will open a command prompt with default reference to the current directory.

5. In what ever condition your phone is in (other than the fastboot mode), press simultaneously the volume down key + power button together for about 8-10 secs. This action will automatically lead your phone to enter the fastboot mode. After entering the fastboot mode you can connect the phone to your pc using a usb cable and your pc should ring a note that it has detected the phone. To check if the pc has detected the phone and the link is established, type the following command in the command prompt window which you opened in step 4

fastboot devices

This command displays your device number if all is well in the command prompt window. NOW you are ready to flash the stock firmware I.E. after successful detection of the phone by your pc.

6. Carefully type each and every of the commands in italics or copy and paste them ONE by ONE and wait for each command to be executed. The commands are being given below to help you (these are for flashing the 6.0.1mm onto the XT1550 only) in the opened command prompt window (Ensure that you do not miss any of the commands and follow the order given below) :

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 system system.img_sparsechunk.6

fastboot flash system system.img_sparsechunk.7

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 erase clogo

fastboot oem fb_mode_clear

fastboot reboot

If you have done every thing correctly till now you should see the command prompt returning a OKAY afer each command with the time taken for flashing each file. This should revive your device first.

After this you may try unlocking the bootloader and rooting as the next step. But be patient and retain a cool head to read first and think clearly..... you will need it a lot as is necessary for such things... good luck and happy learning!!