Beforehand, you can back up your jailbreak apps with Rock or a cydia app called aptbackup. Then after restoring, jailbreak with spirit (spiritjb.com), install whichever one of those you backed it up with, and it will re-download your jailbreak apps. It might even save some settings from those apps.