iCloud services takes control over your contacts and considers this the "master" file for your contacts, photos, etc. So when you add or delete a device, you simply remove your account from the device or sign-in on the new device and your contacts, files and photos appear magically there. That's the theory behind cloud services its a constant push/pull. So when you realize by default that reenabling your iCloud account if you sign-off can reenable the default settings it's too late and your contacts photos etc. are now controlled by the cloud. Some people love the feature others, want to control their privacy and find the idea of default settings turned on is disturbing. The solution is for Apple to set some design specs that honor privacy. So if you have settings that are turned off those values should be enabled if you sign back on to the device. Not sure if this was intentional or some developer on campus thought it would be a good idea for that behavior to take place. If the later this should become a policy to ensure that all privacy settings are universally applied across all devices and OS to ensure that these kind of decisions aren't made at the developer level. Anyway here's the solution to put you back in control of your privacy and get your contacts back.
Removing the files as suggested below is on the right track. They do contain the db file and security for contacts.
- AddressBook-v22.abcddb-wal
- AddressBook-v22.abcddb-shm
- AddressBook-v22.abcddb
Uncheck iCloud syncing by unchecking the value in System Pref > iCloud. It has to be off.
Move the files to you desktop as a precaution.
The reopen contacts. Your contacts should be gone.
Next find in the same directory a file named:
Migration ######.abbu. If you have several use the first one in the list and double-click on it. This is the backup that was made when iCloud by default sync'ed your contacts.
Relaunch contacts and you will see your contacts as they were prior to the sync.
Delete the files on the desktop.