Bought a used HTC One that has a ROM flashed. How do I flash it back to stock?

view full story

http://forums.androidcentral.com – I bought a secondhand HTC One and it ends up that it is already rooted and has TrickDroid flashed onto it. I've flashed ROMs before, but it was on a Galaxy Nexus which made it really easy. So I've read how to root it/unlock it/etc, but how do I put everything back to original? (HowTos)