Thanks for sharing your experience Gerald. It's an vital lesson to learn!
In my case I have made a list of which plugins I want to install on a new Moodle site, including the HotPot and TaskChain modules, and put the list into a Unix shell script. For each plugin, I add in the URL of the git repository (on github.com) where the latest version of the plugin is stored. Then when I run the script, it will automatically fetch not only the Moodle core, but all the plugins too.
I have a similar script for updating the Moodle site. When it runs, it will update the Moodle core and all the plugins - while I am having a coffee break !
These two scripts have saved me hours of time.
Like you, I learned the hard way