You can't undo that unless you have a disk image from before you accidentally did the factory reset.
Pretty self explanatory. How can I undo a system accidentally set to reverted back to factory default. All input would be very welcome and is highly invited. Also can a file recovery program be useful in this scenario. THANK YOU GREATLY for all help, it will be appreciated.