If the device was jailbroken and you used the Erase All contents & Settings option then you may have to try multiple times to get your device functional again.
If the device you have is locked to someone else's iCloud account then restoring the device will not provide you with access to it.