The macOS installer erases the drive when it finds non-OS data on the disk which was the situation in your case. Replace your data from your backup. If you never made a backup, then you've learned a lesson the hard way.
Basic Backup
For some people, Time Machine will be more than adequate. Time Machine is part of OS X. There are three components:
- A Time Machine preferences panel as part of System Preferences;
- The Time Machine application located in the Applications folder. It is used to manage backups and to restore backups.
- Time Machine requires a backup drive that is at least 2-3 times the capacity of the drive(s) it backs up.
To use Time Machine you will need a separate backup drive formatted to use HFS+. This can be an HDD because speed is not that important for backups. The backup drive needs to be at least 2-3 times the size of the source drive. For a 250GB SSD, I would recommend a 1TB backup drive. These aren't too expensive. Visit OWC to see what your options are.
Your SSD can be formatted to use APFS, but Time Machine will not work with that format and should be formatted Mac OS Extended, Journaled.
Backups should always be made on a dedicated drive. If you have extra storage needs, then those also should be made on a separate drive. The Startup Drive should not be used for anything more than a startup drive.
Alternatively, get an external drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
- Carbon Copy Cloner
- Get Backup
- Deja Vu
- SuperDuper!
Visit The XLab FAQsand read the FAQ on backup and restore. Also, read How to Back Up and Restore Your Files. For help with using Time Machine visit Pondini's Time Machine FAQfor help with Time Machine. This is an extensive site with most everything you may need for using Time Machine. You will not find a better resource for Time Machine in one location. Due to the passing of James Pondini, the site is no longer being updated. Therefore, some of the information may be a little outdated.
Although you can buy a complete external drive system, you can also put one together if you are so inclined. It's relatively easy and only requires a Phillips head screwdriver (typically.) You can purchase hard drives separately. This gives you an opportunity to shop for the best prices on a hard drive of your choice. Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu. You can find reviews and benchmarks on many drives at Storage Review.
Enclosures for FireWire and USB are readily available. You can find enclosures at places such as:
All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover. Usually, the only tool required is a small or medium Phillips screwdriver.