How to recover kde desktop after accidental delete of /etc/X11

Stupidly, while fiddling around as root I deleted the “/etc/X11” directory. I reinstalled it by force updating the xorg-X11-server package, but that doesn’t seem to have gotten me back to where I was. Now my vnc sessions start up in some primitive desktop, rather than kde plasma 5 - same if I connect a monitor, log in and issue “startx” (it’s usually headless, hence the main use via vnc).

How do I get kde plasma back?

If you’re installed on BTRFS,
run snapper (preferably from the command line in this instance, it’s easier than using the YaST snapshot module which IMO is easier to use to restore an individual file at a time).

“List” your snapshots, and roll back to a snapshot before you made your mistake, then run “zypper up” to update your system again.

TSU

Thank you so much. That worked perfectly. Coincidently, I’d looked into disabling snapshots a few weeks back. Very glad now that I didn’t get around to it.

Just out of interest, how would I now reclaim a file that the rollback process deleted. It’s an area of config that I’d been fiddling with today. A useful file that I downloaded has disappered. I can get another copy, but I’m interested in how I might use snapper instead. Also, I’m interested why it now says it rolled back the very first snapshot and then put in place a writable copy of the snapshot I asked to roll back to you. I don’t quite get the logic.

I got the file back. 120 was the last snapshot before the rollback. 122 was the last one after the rollback.

snapper diff 120..122

showed me the changes to the files, including the removal of the one I wanted.

snapper -v undochange 120..122 <file path>

got it back