Your method was the other method. Many times, however, if one doesn't restore just the files related to the plugin ... in the proper place, more issues. And folks don't take code backups before installing or deleting plugins. That's a feature Moodle needs .... 'snapshot' of the code with the ability to restore that snapshot.
Developing a plugin ... you might want to look at:
It's improved with 3.4 (exist in 3.5 but haven't tried it yet) in that an archive of the plugin code is made as a zip and stored in moodledata/. Matter of fact, all the updates to all the plugins one has made to additional plugins are in there.
There is a brief moment where the plugin directory is erased and doesn't exist so can see some potential catch22's there ... site using saml2 (sso) and the person doing the update is logged on using saml2 - saml2 checks all users including those that have manual accounts and have logged on as an admin level user to update the plugin.
Personally, I use git for core and mdeploy for additional plugins. It's worked for me so far ... and since am not shy with command line, there is always that as well.
Not discouraging you from working on a plugin ... the mdeploy in core could probably use some tweaks. ;)
'spirit of sharing', Ken