the iphone was jailbroken, i forgot the lock code, i erased all the data for restoring it through icloud, now the phone is not being restored and in a very weird freezing situation.
Put the device in DFU mode, and then restore it via iTunes. You may or may not have to download the .ipsw file for your specific device to install the latest iOS version.