How to restore your iPhone after a jailbreak
Step 1. Choose a recovery mode and extract the iTunes backup
Download iPhone Data Recovery and install it on your computer. Run the program and choose "Recover from iTunes Backup File" and you will get the windows like below. Select your iTunes backup file and click "Start Scan" button.
Step 2. Restore iPhone 6s/6s Plus/6 Plus/6/5C/5S/5/4S/4/3GS from jailbreak
After all data of your iTunes has been found and displayed in the window, you can choose those items one by one to preview and decide which one you need. Or you can just click the whole file and regain data by clicking "Recover".
To prevent data loss, you should always have it in mind that backing up data is quite important. If the lost data has been overwritten, you will lose them permanently.
If you have uploaded your data to iCloud, you can also choose "Recover from iCloud backup file" in step 1 and sign in your Apple account. This way is also quick and easy.