Log out of iCloud and make your Home/Library visible as follows:
NOTE: In Lion and Mountain Lion the Home/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
Then go to your Home/Library/Application Support folder and select the AddressBook folder.
Go into Time Machine, go back in time till you're sure you'll have all your contacts and resotre the AddressBook folder.
Open Contacts and see if your contacts are back. If so the the first thing to do is use the File ➙ Export ➙ Contacts Archive... menu option to make a backup of your contacts.
Then log back into iCloud and see if your other devices will repopulate with your contacts.
Thanks, OT. I can follow your excellent post to a degree...
Unfortunately I can't locate the Address Book folder in Time Machine to effect the restore. I think that part of the problem is that I have A new MacBook Pro and there has been a software update in the meantime - but I could be wrong!
I've started rebuilding my contacts but I'd like to know how this happened in the first place so I can prevent it again.
Thank you again foryour excellent post.
Were you able to find your Library folder in the Time Machine backups? They may be invisible if there were invisible at the time of the backup.
There's are apps, Show Hide Invisible Files 1.6, Invisibiliey Toggler, InVisibles and TinkerTool that you can run to make all invisible files visible. Then enter Time Machine, go to the LIbrary/Applicaitons Support folder and find the AddressBook folder. When you're done run the app again to make those files invisible again.