Deleting all personal information

Hey everyone I have a jailbroken/unlocked iPhone 3g I'm looking to sell, so I need to delete all my personal information on the phone before doing so. My question is how's the best way to go about doing this to not lose the jailbreak and unlock?

Thanks
setting---> general---> erase all content and settings
would be your safest bet

Original thread: https://forums.imore.com/threads/deleting-all-personal-information.186121/