I'm not quite sure what you are asking, but am going to assume you mean that you want to restore the phone to its official software.
"Factory reset" just erases user-installed apps and data, so won't restore your original ROM. You need to download a set of official software and flash that. Where you will find that software will depend on what manufacturer, what country and possibly whether it was a network version of the device or not. What tools you need to flash it will depend on the manufacturer. So without knowing exactly what device you have (at the minimum the manufacturer and full model number, country and possibly the carrier it was originally sold to may also matter) we can't say anything more than that.