Unlocking the iPhone has absolutely nothing to do with resetting the device and erasing all content. If you want your device unlocked from your carrier, you must contact the carrier to see if that carrier unlocks devices, and what you must do to qualify.