[Moto X General] KidJoe:
[NOT YET SPELL CHECKED!!!]

How to return to stock & Unrooted... (Windows options only, as I don't have a Mac) Note: Some Windows 8/8.1 users have had issues, so when possible, please use Windows 7.

The following are listed in the order I originally posted them HERE and HERE

Requirements: These are the same no matter which option you use.

To repeat what I said in the OP, Do NOT attempt to downgrade your phone!! Please be aware of the risks -> [INFO/WARNING]The Risks of Downgrading, and the impacts of GPT.BIN and MOTOBOOT.IMG

Know what version ROM is on your phone before you touch anything. Normally I would suggest BEFORE you flash away from Stock, on the phone you first go App Drawer -> Settings -> About Phone... Make note of what is listed under System Version, Android Version, and build number. Then visit one (or all) of the sites that host leaked ROMS until you find the SBF that matches and down load the file to your PC for use later.. The file name will usually contain parts or all of that info listed under settings, and possibly the carrier name, or acronym for the carrier name (Verizon might be VZW, Rogers Canada might be RCI, etc).

So for example: If your phone model is XT1058 and under about phone it reports...

android version is 4.4.4

system version is 212.44.26. ghost_row.RCI.en.ca

build nunber is KXA21.12-L1.26

That tells me you have a Rogers Canada (RCI) XT1058 with 4.4.4 ROM on it. When you look at the file factory site for your SBF, you want to look for a file that contains some/all of that info, and you'll find... XT1058_RCI-CA_4.4.4_KXA21.12-L1.26_59_cid14_CFC_1FF.xml.zip

(notice the parts of the "about phone" info and file name which are highlighted in Bold to help illustrate the example)

IF you are already running a CUSTOM or 3Rd party rom, like CM, system version and build number will not match STOCK Moto SBF files

You must have already installed the Motorola Drivers, ADB, Android Platform Tools, and mFastboot

mFastboot (get from the previous link). NOTE: Stock fastboot that ships with the Android SDK/Platform tools can NOT flash the SYSTEM.IMG on Moto phones!!

Download ROM/SBF files for the ROM currently on your phone!!!! from one of the sites listed HERE. Failure to use the EXACT SAME ROM/SBF that is on your phone now can cause problems!!

Your battery has an 80% or greater charge!!

MicroUSB Cable.

Know how to start your phone into the Fastboot AP/Bootloader mode...

Unplug phone

Power down phone.

Hold Volume Down and Power

After a few seconds release Power, you should be in Fastboot AP menu on phone.

The Options...

NOTE: I most often recommend option 5.

Option 1... The "Moto X Tool Kit"

This is the most newbie friendly.. But it can be a little complex to prepare and put your SBF in the right place, etc.

See -> [TOOL] Moto X Toolkit v1.4.4 [Backup/Restore,Drivers,Return to stock,Root,Bootani]

It is an "all in one" type tool that should set things up and help you too. I've not used it, but it appears to be a complete package including ADB and the drivers. The only thing it does not appear to include would be Roms for your particular phone, so, you'll likely need to download the ROM for your phone separately. As noted in the ToolKit thread, if they are available, you can get them from here -> http://sbf.droid-developers.org/ghost/list.php your "build number" or part of it, should be in the file name you are downloading.

Again, I haven't used this tool, so for install, setup and usage, I'll have to point you to that thread to ask. Two main options you'll be interested in... UNROOT (which keeps your data and apps) or FLASH BACK TO STOCK (which will likely also completely reset your phone and wipe any/all data, settings, applications, etc).

Option 2... mFastboot flashing individual parts of your phone's firmware.

This will not erase your data and apps. It is a good option if you are stuck in a boot loop.

If you have made very few changes to your phone and already have ADB drivers and fastboot from the Android SDK installed and in your path, along with the Motorola drivers already installed and working, this is the quickest and easiest way to return to a state that is ready to accept an OTA without losing data/apps.

NOTE: you may need to disable and/or uninstall Xposed before doing this.(To disable Xposed, boot to TWRP and install /SDcard/Android/data/de.robv.android.xposed.installer/files/Xposed-Disable-Recovery.zip ) Keep in mind there is a newer version of Xposed needed for Lollipop!!

After you have the requirements as listed above, the steps would be as follows...

Start the phone in Fastboot AP/Bootloader mode.

Connect phone to PC via USB cable.

open command prompt file and change to the folder you unzipped the ROM file to.

type the following, pressing enter after each command, and wait for it to finish before going onto the next...

mfastboot flash boot boot.img

mfastboot flash recovery recovery.img

mfastboot flash system system.img

mfastboot reboot

phone should reboot and be back to stock and ready for the update.

NOTE: to combat a 410 ERROR while doing the update, some users have also had to also do the following

fastboot flash modem NON-HLOS.bin

fastboot flash fsg fsg.mbn

See -> http://xdaforums.com/showpost.php?p=47639731&postcount=315 (thanks jimmydafish)

Option 3... Fully flash your phone using RSDLite while attempting to keep your data and settings

NOTE: this has the potential to erase your data if you don't edit the XML properly before flashing.

Follow this guide -> [GUIDE][VIDEO] Moto X - Return to 100% stock (using RSD Lite OR manual flash) using SBF of the ROM currently on your phone, or newer for your carrier and model. HOWEVER, before doing it, as part of STEP 4 while editing the XML file, also remove the line that says...

<step operation="erase" partition="userdata" />

Failure to remove this line will result in your data/apps/settings being erased from your phone!!

Option 4... Fully flash your phone using RSDLite

Note: this WILL ERASE YOUR USER DATA AND APPS, and put you back to a "fresh" phone.

Follow this guide -> [GUIDE][VIDEO] Moto X - Return to 100% stock (using RSD Lite OR manual flash) using the ROM from your carrier.

Option 5... Using mFastboot to manually flash your phone's firmware (without wiping data).

This is very similar to using option 3, but uses Moto fastboot instead of RSD, however it adds a few steps which aid in flashing when your GPT.BIN and MOTOBOOT.IMG are mismatched from the rest of your rom, and refuse to flash.

As written, these steps will NOT erase your data and apps. Because of this you may need to disable and/or uninstall Xposed before doing performing these steps.(To disable Xposed, boot to TWRP and install /SDcard/Android/data/de.robv.android.xposed.installer/files/Xposed-Disable-Recovery.zip ) Keep in mind there is a newer version of Xposed needed for Lollipop!!

After you have the requirements near the top of this page, the steps would be as follows...

Start the phone in Fastboot AP mode.

Connect your phone to PC via MicroUSB cable.

open a command prompt and change to the folder you unzipped the ROM/SBF file to.

type the following, pressing enter after each command, and wait for it to finish before going onto the next... NOTE: yes, there are a few commands being repeated, but this is intentional!!!

mfastboot getvar max-download-size

mfastboot flash partition gpt.bin

mfastboot flash motoboot motoboot.img

mfastboot reboot-bootloader

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

mfastboot flash modem NON-HLOS.bin

mfastboot erase modemst1

mfastboot erase modemst2

mfastboot flash fsg fsg.mbn

mfastboot erase cache

mfastboot reboot

The phone should reboot and and be ready. (it could take a little longer than a normal reboot)

NOTE: if you wish to erase your data and apps during this process, just before the final reboot command, issue... mfastboot erase userdata

Option 6... Flash only stock recovery.

This option is useful if all you did was unlock your bootloader, flash TWRP recovery, and rooted. It can be used if you've haven't installed Xposed, or modified any stock apps, and only run rooted for apps like BigTinCan's Adaway, Root Explorer, Wifi Tether for Root, etc.

Start the phone in Fastboot AP mode.

Connect your phone to PC via MicroUSB cable.

open a command prompt and change to the folder you unzipped the ROM/SBF file to.

type the following, pressing enter after each command, and wait for it to finish before going onto the next...

mfastboot flash recovery recovery.img

mfastboot reboot-bootloader

Use the VOL DOWN Key to SCROLL to Recovery and VOL UP Key to select

The device will display the Motorola logo and then the Android in distress (logo with Exclamation mark)

Press and hold the VOL UP key for 10-15 seconds. While still holding the VOL UP key tap and release the POWER key

The device will start in Stock Recovery display additional menu options (Text will appear in BLUE)

While in Stock Recovery, use the VOL DOWN Key to scroll and the POWER Key to select the option you wish to use.

You may now use the option to reboot the phone.