WARNING: All data, including messages and contacts will be lost, so it is mandatory to make a backup on the SIM card or on the computer. The backup can also be performed on an external card or hard disk. It is advisable to remove the SIM before making process. In principle, this process does not affect the SD card, but as precautionary measures listed can also be removed.
Restore by force
Press and hold for about 7 seconds or more. This method is useful if the phone does not react anymore and has been frozen.
Unlock the Galaxy S4 using hard reset
Turn off your phone
Press and hold Volume Up + Home + Power or even simply Volume Up + Power
Wait until you exit the Android logo. At that time release all buttons.
Select Wipe data / Factory Reset. You can use the volume buttons to navigate and the Power to selccionar.
Select "Yes - delete all user data".
Once the process is finished, you can go restarting the terminal by "reboot system now".
Unlock the Galaxy S4 entering code format
Type the following code: * 2767 * 3855 #
NOTE: If you reset the device to factory default settings with SD card encryption enabled, the device will not be able to read the encrypted files. Disable this option before performing hard reset.