Yes, a factory reset removes all data from the iPhone and sets it to the default settings. You can keep a backup before the factory reset to recover the data later.