Broke my installation with a failed upgrade - how can I recover?

You can try

cd /var/discourse
./launcher rebuild app

That might do the trick. If not, it’ll likely be hard to guess.