Switch off your Xperia Z. Its better if you remove your battery and insert it again.
Keeping the device being switched off, press and hold the Volume Up and Volume Down buttons. Keep these two buttons pressed and then press and hold the Power button.
Keeping these three buttons pressed will bring a menu on the screen. Navigate to the recovery option with Volume Up and Down buttons. Select the recovery option with the power button.
Now you will see an Android logo on the screen. Press and hold the volume up and volume down buttons, which will bring your device to the recovery menu.
The recovery menu will have many options in it. You will need to search for an option like Wipe data/Factory reset. Now press power button to select it.
- See more at: http://www.allflashfiles.com/hard-reset-sony-xperia-z/#sthash.D8Cc15zN.dpuf
1.Please install the latest version of the Sony PC Companion on your computer.
2.Do not connect your phone to your computer until you reach that step in THIS tutorial.
3.Once you reach the welcome screen, select “support zone” and then “start”.
4.Select “software update” and then “start”.
5.The program will alert you that there is no phone detected and give you the option to “Repair Phone”, choose it.
7.Choose Sony Xperia Z from the list and click “Next”.
8.Connect your USB cable to your computer (not the phone, yet!).
9.Press and hold the back key on your phone and THEN connect the USB cable to your phone.
10.ONLY release your hold of the back key when the Sony PC Companion alerts you that the update has started
if u have google accout locked.(too many patern atempts)
then try ths.
1.switch on mobile "mobile show google lock"
2.then go to emergency call press this code *#*#7378423#*#*
after pressing key display show four option
3.choose "customization setting"
4.then press "reset customization" phone will reboot & reset