[One (M7) Q&A, Help & Troubleshooting] Matt:
This guide will help you to restore your phone if you happen to have wiped your internal sdcard and have no way of getting your phone to boot to a functional state.

This method is 99.9% safe, and should anyone break their phones as a direct result of this guide, I will send a donation :D

Requirements: A computer running either Windows or Mac

An unlocked bootloader, which can be achieved at http://www.htcdev.com/bootloader

This guide, best served cold, comes in three parts:

Unlocking the bootloader

Installing the ADB drivers

Restoring your phone

Feel free to skip to the part you require, and I hazard a guess at saying most people can skip straight to the third and most important part, where the magic actually happens.

Unlockin' the bootloader

First off, you need to head over to HTC Dev and select 'All Other Supported Models' in the little drop down menu, then press the big green button as shown.

This will then require you to register, and you can then follow the steps provided by HTC. Obviously, during this process you're gonna come to a point where ADB drivers are needed to flash your unlock token, so take a peek down the page. I aren't going into detail with this unlock guide because I am fully aware that there are detailed guides elsewhere in the forums, from people who have a lot more time to sit and explain things than I do.

Installin' the ADB drivers

Howdy partner, this here thang be the most important thing you can ever do regarding your Android and PC ecosystem, and you're gonna be hella glad that you did it. After installing ADB, you're free to enjoy the wonderful world that is logcats, custom recoveries, ROMs, kernels; the whole package!

First off, select your OS!

​

Windows 7

Congratulations! You have managed to avoid the flop that is Windows 8, kudos to you.

First, head over to HTC Sync Manager and download this and install, to gain the required drivers.

Now, head over to the Android SDK and download it, using the big blue download button. Simpless.

Extract this zip file to the root of your C:/ drive.

Now you're done! To check it's working, open the platform-tools folder of the SDK and then hold down Shift, Right Click and press 'Open Command Window here'.

Now, type

adb devices

If your device is plugged in, and powered into Android or a custom recovery, it should appear as a serial number here!

Windows 8

Sorry to hear you're stuck with the latest and far from greatest iteration of Windows, but don't let that Metro interface get you down! Lets crack on.

First, head over to HTC Sync Manager and download this and install, to gain the required drivers.

Now, head over to the Android SDK and download it, using the big blue download button. Simpless.

Extract this zip file to the root of your C:/ drive.

Now you're done! To check it's working, open the platform-tools folder of the SDK and then hold down Shift, Right Click and press 'Open Command Window here'.

Now, type

adb devices

If your device is plugged in, and powered into Android or a custom recovery, it should appear as a serial number here!

Mac

Finally, someone with a good taste in operating systems :D This is the easiest thing you will do all day, believe me.

First, head over to HTC Sync Manager and download this and install, to gain the required drivers.

Now, head over to the Android SDK and download it, using the big blue download button. Simpless.

Locate the zip, or folder (if you have 'Open "safe" files' turned on) in your Downloads folder and drag it to your Desktop. If it ain't extracted, give it a double click to extract it.

Now open the folder and navigate to 'platform-tools'. Drag this to your Desktop out of the main folder.

Open Terminal and type:

cd Desktop/platform-tools
./adb devices

If your phone is plugged in, and powered into Android or a custom recovery, the serial number will show up here. Congrats, adb is set up, now lets restore your phone.

Usin' ADB Push

So, you're stuck in recovery and cannot boot, or you just need to transfer a file to your phone for whatever reason... This is the method to transfer a rom back onto your phone, in order to make it fully functional again. This works in both recovery and booted Android, meaning it is also a good way to transfer music and photos when your phone boots again. This process doesn't wipe any data.

First, open platform-tools (your adb folder as described above). Download any ROM from the HTC One section of XDA and drag the .zip inside here

Hold down Shift and Right-Click, selecting 'Open Command Window Here'.

On a Mac, open Terminal and type;

cd Desktop/platform-tools

to achieve the same result.

Now, we are ready to use the ADB push command.

Plug your phone into your computer in recovery mode, and in CMD type:

adb push NameOfRom.zip /data/media/

Be aware that on Android 4.2.2, you need to type '/data/media/0/'

On a Mac, type:

./adb push NameOfRom.zip /data/media/

(or /data/media/0/ if coming from a 4.2.2 rom)

Now, wait for the process to complete. This takes on average around 260 seconds for a 900mb rom, with no progress indicator. Don't worry, it hasn't frozen.

When it completes, type:

adb reboot recovery

or

./adb reboot recovery

on a Mac.

Your file can now be found on your sdcard, and can be flashed from the 'Install zip from sdcard' screen.

That's it, you have saved your phone, and can now get back to using it again!​