You have to factory reset your iPhone via "Settings -> General -> Transfer or Reset iPhone -> Erase All Content and Settings" to clear all data from it.