Both iPhone and Android have programs to recover a deleted phone number. iPhone has PhoneRescue and iPhone Data Recovery, while Android has Android Data Recovery. These programs are available for Windows and Mac.
iPhone's PhoneRescue and Data Recovery programs recover lost or deleted data on any device, supporting all models of iPhone, iPad and iPod. They do not require backup. Android's Data Recovery, on the other hand, recovers contacts from phone memory or SIM card. It also recovers deleted or lost text messages, photos, documents and media files by default. All programs require connecting the device to the computer via USB.