I decided to try to install the proprietary nVidia drivers. It should have been the '390 drivers but I installed '340 instead (forgot which graphics card I had). Now, when I reboot, the login screen is something like 800x600 and when I try to log in, I momentarily get a desktop (long enough to see the bluetooth/volume/power/etc/ icons at the top left, but they also seem to be at a low resolution) and then I get dumped back into the login prompt. I can access a terminal via CTL-ALT-F2. So how do I go about reverting back to the nouveau drivers using just the command line?
An option to revert back is to use AppCenter > Installed, wait until the nvidia drivers become visible on the top, click on the icon of the one that is installed and then uninstall.
Using command prompt only,
sudo apt purge nvidia-* or
sudo apt remove nvidia-* . For the first command line option to work probably you have to install purge.
sudo ubuntu-drivers autoinstall
Was the first step in what worked for me. That installed the right set of drivers and at least got me to a desktop, but it turns out that I could only get 640x480 resolution. After this, the nVidia Settings window comes up completely blank (except for Apply and Cancel buttons) and the native System Settings->Displays icon would close System Settings whenever I clicked on it.
showed that the system believed 640x480 was the only option available and hence, any attempt to use another was rejected.
In the end, I took a chance on using a previous version of the kernal from the GRUB menu and updated the drivers and resolution from there.
Everything works now. I should have thought of that sooner :-)