How do I restore my lost contacts?
You can restore contacts with a Time Machine Backup.
You may be able to restore from iCloud, using your iCloud account, if it had not been deleted there -- though, by the sound of the question, this seems to be how they were deleted in the first place.


Edit: I agree that a more complete answer may be desired, however one cannot ascertain what the OP knows about restoring a file from Time Machine, not to mention different OS X versions may store files in different places.  That said, I would think a simple search would find results -- I much rather encourage self-exploration than laziness.

https://www.macobserver.com/tmo/answers/how_to_restore_os_xs_address_book_data_from_a_time_machine_backup
The following is copied word-for-word from this link, so be sure to click to link to contribute to MacObserver's ad revenue:

Yes, there is a way to restore Address Book content from a Time Machine backup. However, it’s important to note that Address Book data is used by many applications throughout OS X, so before we begin, make sure to quit all open applications to make sure we minimize the possibility of introducing problems.



Location of Address Book Data
Next, to be on the safe side, make a backup of your existing Address Book library. That information is located in [home]/Library/Application Support/Address Book.
Now, hop over to your Time Machine drive in Finder and navigate to the same location under “Latest” in the Time Machine backups folder. Copy the entire contents of the Address Book folder from the backup and overwrite the contents of this folder on your system drive.
Once the copy is complete, relaunch Address Book and you should see your contacts listed, current as of the date of your last backup.
Note that in this case, the listener had performed a clean installation of OS X and her Time Machine backup was no longer linked to her system. If you have a current backup that’s still linked to the OS, simply navigate to the Address Book folder on your system drive, launch Time Machine, and restore the files from within the Time Machine interface.