If you're anything like me, one of the first things you do with a new phone is modify it. Specifically I'm talking rooting and ROMing the phone, but what happens when something breaks? I found myself in this situation with the OnePlus One, where I was trying to flash a simple file and it ended up bootlooping the phone, throwing me into a fit of panic and chaos for the next four hours as I scoured forums to figure out how to get the phone back to a working state. I ran across many problems along the way, and it's all because this phone is so new and so few people have it that there isn't much of a community to help users with it. Thankfully XDA member graffixnyc was there to help, and it's his files and instructions that ultimately helped me get to where I needed to be. So today I'm sharing those with you in an effort to help you avoid the frustration and panic I went through, and the process couldn't be much simpler as it's going to be mostly copying and pasting code into a command prompt to get that lovely OnePlus One back to stock.
This guide will also help if you're using a Chinese OnePlus One that comes with ColorOS instead of CyanogenMod 11S, as the hardware is the same and you should have no problems flashing to CM11S as many other forum users have been able to. As usual with these sorts of things we don't guarantee success, and while this worked for me it may or may not work 100% for you. Be sure to visit the OnePlus One Section of the XDA-Developers forum for all your support needs when it comes to these sorts of after-market modifications.
First thing's first, grab all the tools and files you'll need. Start with the Nexus Toolkit as that contains all the files you'll need to perform the actual flashing itself. Next up grab the full set of stock files from the official CyanogenMod OnePlus One Product Page, located near the bottom, and be sure to grab the one with "fastboot" in the title. At the time of writing the name of the file was cm-11.0-XNPH22R-bacon-signed-fastboot.zip. Unzip these files in the same directory where your Nexus Toolkit files are stored, in my case C:\Program Files\WugFresh Development\data. All the files need to be in the same directory as the fastboot.exe file is in. You can see a listing of files in the picture below.
Once you've got the baseline all set go ahead and hold down power until the phone shuts off completely, then power it back on by pressing and holding volume up, then holding power at the same time until you get a boot logo. Your OnePlus One should now be in Fastboot mode as indicated on screen. This is where you're going to flash all your files, and you WILL lose EVERYTHING on your phone, including any pictures taken, etc. etc. I found this out the hard way, but if you can't boot into your phone there's not much you can do about it now. The only saving grace will be to try and not flash the userdata partition, which we'll cover below, and see if your device will at least boot so that you can recover your files.
Once your phone is in Fastboot mode open up a command prompt and navigate to the directory where your Nexus Toolkit files are stored, again on my computer it's C:\Program Files\WugFresh Development\data. From here issue the following commands one at a time, waiting until the command says success or completed before moving onto the next:
fastboot flash boot boot.img
At this point you'll need to make a decision. First, if you have anything on your phone that you want to save, skip this step for now and continue onto the rest of the commands. If you're ready to fully wipe the phone you need to choose between two files. If you have the 16GB OnePlus One issue the following command:
fastboot flash userdata userdata.img
If you have the 64GB OnePlus One issue the following command:
fastboot flash userdata userdata_64g.img
From here continue on and issue the rest of the commands below, again one by one, only following with the next command after you've received a completed or success message.
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash cache cache.img
fastboot flash modem NON-HLOS.bin
fastboot flash sbl1 sbl1.mbn
fastboot flash dbi sdi.mbn
fastboot flash aboot emmc_appsboot.mbn
fastboot flash rpm rpm.mbn
fastboot flash tz tz.mbn
fastboot flash LOGO logo.bin
Once you've completed all the commands your phone should now be booting into CyanogenMod 11S as if you took it out of the box for the first time. If you skipped the step to flash userdata and the phone still won't boot up, go back and flash that file, otherwise you should be good to go. If you'd like to root the phone make sure to do it upon boot up before you accept any updates, as my phone wouldn't take the custom recovery after the second update. You can follow our rooting guide here. Have fun and enjoy your OnePlus One!