In case of pure disaster you can lose your X, and mess up your X-Config file. This tells you how to fix that.
In the case of a failing X you get thrown back to the prompt in a text console in runlevel 3, just to check that do:
$ root ( not "su" because you´re not logged in as user yet )
< password >
# init 3

This because the following actions should absolutely not be done in another run level. ( In Ubuntu and Debian please boot up in "safe mode" )
We stay logged in as root and first do:
# Xorg -configure