WARNING! When you factory reset your phone, all your personal data located on the phone’s internal memory will be deleted, including media files, contacts, ringtones, downloaded content etc. but data located on the SIM and SD cards. Furthermore all settings will be restored to factory values.

NOTE: Before resetting the phone, you can check this thread for instructions on backing up data, and this thread for a guide on restoring data.

Factory Reset via Settings:

  1. Open “Settings
  2. Go to “Personal” and tap “Backup & reset
  3. Optionally, turn “Automatic restore” and “Back up my data” ON or OFF
  4. Tap “Reset phone
  5. If your phone is protected by a lock screen, enter your PIN/password
  6. Optionally you can also choose whether to “Erase SD Card
  7. Tap “OK” when ready

Factory Reset via Android Recovery:

NOTE: If your device freezes, crashes, or otherwise prevents you from resetting it via Settings, alternatively you can try resetting the device from the Android Recovery menu.

  1. Turn the phone Off if necessary
  2. Next, press and hold “Power” and “Volume down” at the same time
  3. When the phone vibrates, release “Power
  4. At the “hTC download” screen, release “Volume down” too
  5. While in the hTC download menu, press “Volume down” repeatedly to navigate the menu and highlight “Reboot to bootloader
  6. Press “Power” to select the highlighted option
  7. Next, highlight “Boot to Recovery Mode” and press “Power
  8. At the “No command” screen, press and hold “Power” and “Volume down” at the same time
  9. Release the buttons once in Android Recovery
  10. Use the volume keys to navigate Recovery and highlight “Wipe Data / Factory data reset
  11. Press “Power
  12. Highlight “Yes – delete all user data” and press “Power” again
  13. Once the process completes, ensure “Reboot system now” is highlighted and press “Power” one last time

See More: HTC Desire 12: Factory Reset via Settings or Android Recovery