Contacts deleted after signing in to iCloud
Hey, I'm using an iPhone 3GS
I hadn't signed in to iCloud earlier, and had a lot of contacts on my iPhone. I signed in to iCloud, turned on contacts, selected "merge" in the pop up that follows hoping they would get backed up to iCloud but all of them got erased instead. How can i recover them?
iPhone 3GS, iOS 8.4.1