Sony Xperia Z1 hard reset
Reset your Sony Xperia Z1 C6902 Android phoneIf your phone is responding to screen input, then open Settings from the Applications menu. Tap Backup & reset > Factory data reset, click Reset phone and then Erase everything to format your phone.
Your device freezes or has fatal errors
If your device freezes or hangs, you may need to close programs or reset the device to regain functionality. If your
device is frozen and unresponsive, press and hold the Power key for 10-15 seconds. The device will reboot automatically.
While using your device, be sure to back up important data. When disposing of your device, back up all data and then reset your device to prevent misuse of your personal information.

Sony Xperia Z1 hard reset using firmware update
You need an unlocked boot loader on your phone.To check please access to the service menu by entering the following code in the dialer: *#*#7378423#*#*
(*#*#SERVICE#*#*)
Tap Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then you can update your phone.
Note! The SD card of your device will be formatted and you will lose all content (for example photos, music, videos) when you unlock the boot loader.
If you want to upgrade your Xperia Z1 software / firmware you have to connect your turned off phone to a computer via USB cable, and press the Volume down key as the "flash key" until the flash tool recognize your phone. You also need Xperia Flash tool from sonymobile website. Sony mobile EMMA setup tool.
After you download the Sonymobile Xperia EMMA flashtool software, install it. Turn off your phone. Connect it via USB cable to your computer, while you press and hold the VOLUME DOWN key. In the flashtool the available software will be displayed under service window. Select it and press Apply service. The phone will be automatically flashed. After firmware update the phone will reboot. Be patient for the first time after upgrade. Note! After software update all data will be erased!
Sony Xperia Z1 Honami, Sony Xperia Z1 C6902 / L39h, Sony Xperia Z1 C6903, Sony Xperia Z1 C6906, Sony Xperia Z1 C6943