it will most likely be through pwnage tool or similar app, so you'll have to restore to a jailbroken 4.1 that will be generated by pwnagetool or other app. to make things as least painful as possible, restore it as a new phone, and not backup. just remember that if you want to keep your photos, sms messages, etc., that you'll have to back them up first.