For JailBreakers, who wants
to to wipe their device clean to factory
settings without losing their jailbreak then Semi-Restore is the
best tool for restoring your iDevice without loosing your jailbreak. 
Because when you restore
your iPhone through iTunes it forces you to update to iOS 8.3, and you’ll
loose your jailbreak.
You might be in confusion,
Why not just go into Settings and select Erase All
Content and Settings
?” That’s a valid question, but doing so on a
jailbroken iPhone or iPad will result in a bootloop,

for which you’ll have to
do a hard restart to get back to the lock screen, and you’ll be back to where
you started or you will stuck in apple logo & you will have to restore to
the latest version which will lose your jailbreak. 

So keep in mind, The only
way to restore your iPhone back to factory settings but can’t afford to lose
your jailbreak (since iOS 8.3 isn’t jailbreakable), then there’s a way to
restore your iPhone while keeping your iOS 8.1.2 jailbreak intact is to use this
Semi-Restore Tool.
Semi Restore is Compatible
with all iPhone 3, iPhone 4, iPhone 4S, iPhone 5S, iPhone 5c, iPhone 6, iPhone
6 plus, iPod touch, iPod 4, iPod 5, iPad mini, iPad air, iPad 3, iPad 4 models
running iOS 5.0 through 8.1.2(according to your iOS version installed on your
iDevices.)
Here’s how to restore your
iPhone without losing your iOS 8.1.2 jailbreak.
Note: This process will be
same whichever iOS version you have got on your iDevices.
  • For this, your iPhone has OpenSSH
    installed, which can be downloaded through Cydia.
  • Download iTunes v12.0.1 . Not
    latest version because you will get an error.
  • Download Semi-Restore Tool here. Windows • Linux
  • Connect your iDevice via USB or
    Lighting Cable.
  •  Launch Semi restore tool,
    after it detects you will see the restore button.
  •  Click on that and wait for
    5-10 minutes of your time.
  • Your device will
    respring or reboot several times during the Semi-Restore. This is
    perfectly normal, so don’t panic.
  • Enjoy ..your idevice has been
    restored and you have Cydia on your homescreen.
  • Launch Cydia and install tweaks as
    your wish.
If you want to jailbreak
your iDevice running iOS 8 then follow these link;