Deleted contacts, how can I get them back?

Deleted Contacts.

A friend of mine gift away his old i-phone to me, before that he deleted the contacts from the phone while being unconnected to wifi, when handed he didn't logout from his account, i got home and connected the phone to the internet, the next day he told me that all the contacts from his i-cloud were deleted because I?ve connected the phone to internet. Is it possible this thing ?. And how can i restore the contact ?
Re: Deleted Contacts.

It is possible.

He will need to restore from a backup to get his data back. When he deleted all the contacts without signal, but left the account on the device, as soon as you connected to wifi it sent all those deletes to the cloud.

you should wipe the device he gave you so nothing will be left in their name. Settings > General > Reset > Erase all content and settings

Original thread: https://forums.imore.com/threads/deleted-contacts-how-can-i-get-them-back.332217/