The User Restore plugin by Sebsoft is officially compatible with Moodle up to 3.7 and appears to be in active development as of February 2020
Here’s a handy tool if you’re in the habit of deleting users rather than suspending or archiving them: a way to restore a user who’s been deleted from your system.
The tool, which works best on Moodle 2.7 versions and newer restores user information from the user table and logs bringing the user back to your Moodle’s userbase (and even notifying the user if you so choose). Administrators of pre-2.7 versions beware though, according to the description,
Before Moodle 2.7 there is NO way we can retrieve all information. However, with Moodle 2.7 and the new event logging tables, the original user information is stored in the event data. Therefore, from Moodle 2.7 onwards, this plugin will try and restore the original user information from there.
This effectively means, that from Moodle 2.7 onwards, we will have the correct original username, email, idnumber, picture and mnethostid. Before that, only the email could be restored, and even that method is not foolproof (due to the fact the username is cleaned with PARAM_USERNAME upon deletion).