It seems annoying that when you boot into Ubuntu on a Mac it takes over and becomes the default OS, even if something else (e.g. macOS or Boot Camp Windows) was previously the default.
The only way I have found to get back macOS as the default boot OS is to fully boot back into macOS (using Alt/Option on boot to select it), and then manually set macOS back to being the default using 'System Preferences/Startup Disk', which seems a bit excessive.
I'm actually going to post my own command line answer which I've worked out.
But I am also genuinely very happy to hear and up-vote any other command line or GUI-based answers which can set macOS back to being the default from within Ubuntu. (Or can prevent Ubuntu from taking over as the default in the first place!)