I have a problem restoring my iphone after its been on erase all content mood

Okay so i have a jailbroken iphone on ios 8.1.2 (iphone 4s) and i tried to get rid of the jailbreak by deleting everything and then i got stuck on erase all content mood and its been stuck on that for 6 hours! So i tried looking online and it said to restoring it on itunes and it works perfectly fine until it when its almost finishing restoring it says "The iphone cannot be restored. An unknown error occurred." Please help I dont know what to do anymore. :/
Look into getting the phone into DFU mode and restore from there.
First of all, make sure that you’re running the latest version if iTunes. Then, just put your device in DFU mode and connect it to your computer/iTunes. It will download the latest iOS and install it for you. Good luck.

How to put your iPhone or iPad into DFU mode | iMore

Original thread: https://forums.imore.com/threads/i-have-a-problem-restoring-my-iphone-after-its-been-on-erase-all-content-mood.329563/