Unrooted

So you've rooted/S-OFF'd your HTC EVO 3D. Congratulations! But now you're starting to think about the inevitable times when it will necessary to return to an unrooted/S-ON state. Whether you just want to prove to yourself that you can do it or you have to return your phone to Sprint, you can easily unroot your EVO 3D in a handful of steps.

First, you need to download the stock RUU. Essentially, once this is installed, you will be "unrooted." After downloading the PG86IMG.zip file, move it to the root of your SD card (i.e., the highest level you can place a file on your SD card), then boot into the bootloader.

This can be accomplished in several ways. If you have flashed a custom ROM, then when you hit the power button and select "Restart" you may have the option to choose "Bootloader." Not all ROMs have this option, but some do. You can also go to the Android Market and download the free app Quick Boot, which gives an easier option to restart into the bootloader. The final option, which any EVO can do, is to turn your phone is off and then turn it back on by pressing the power and volume down keys together at the same time. This will bring you directly to the bootloader.

When you enter the bootloader, the EVO 3D will scan the root of your SD card for the PG86IMG.zip file and ask you if you want to install it. Press the power button to confirm.

Once this completes, you can reboot your EVO 3D and see that your phone is back to a stock ROM and is unrooted. In a pinch, this may be good enough for a return.

Some phones do ship S-OFF, but an EVO 3D with S-OFF would be rare. To play it safe, it is best that you flash your phone back to S-ON (which is the default). 

Go back to the bootloader and do not install the PG86IMG.zip again (you can actually just delete that file now). Go to FASTBOOT and connect your EVO 3D to your computer.

For this next step you need to have the Android SDK on your computer and have ADB (more specifically Fastboot) up and running.  Then open Command Prompt/Terminal on your computer and navigate to where fastboot is located (on my Windows 7 computer, it's C:/AndroidSDK/tools/. Now, type in the command: 

    fastboot oem writesecureflag 3

Once this completes you can go into your bootloader and should no longer see "S-OFF" at the top of the screen. It will read "S-ON." 

Congratulations again! Not only do we have the ability to root/S-OFF the holy grail of cellular devices, the HTC EVO 3D, but we now have the ability to unroot/S-ON the holy grail of cellular devices. 

Now, remove any root related items from your SD card (including the PG86IMG.zip, if you didn't delete it earlier) and you are good for return (or ready to re-root).

[xda-developers] Thanks to Mike for pointing out a correction!