Replace /etc/X11/xinit/xinitrc with the you distro's original xinitrc file. You did back that one up, right?
If not, you can create a ~/.xinitrc file that just contains exec startkde for KDE, or exec gnome-session for Gnome.
The filenames are different if you do the GUI login thing, but I don't remember offhand what they are. .Xsession perhaps?