I just had a client who double-clicked the "Displays" icon in system preferences and inadvertantly changed his display setting to a really low resolution that left him unable to operate his computer. Here are the steps I took to correct it, and we repeated the entire process to verify that they work and are repeatable ...
Either log in through the network using ssh (which is what I had to do), or reboot in single user mode by holding down the shift key while booting.
Remove the windowserver preference files using the following commands ...
rm /Library/Preferences/com.apple.windowserver.plist
rm /Users/[username]/Library/Preferences/ByHost/com.apple.windowserver.*
(On that second one, you need to replace the [username] with the name of the user's home folder who made the change. If the user that made the change wasn't an admin user, you may be able to skip the first step. Also, if you have multiple displays, the 2nd command will remove the settings for all of them. If you want to be more specific, you can navigate to the user's Library/Preferences/ByHost folder and list the com.apple.windowserver.* files to see which one was recently updated, so you can delete just that file.)
Finally, after removing the com.apple.windowserver preference files, you'll need to shutdown or restart and reset the PRAM by holding down Option-Command-P-R while the system is booting and waiting for it to reboot (you should hear a 2nd chime, then you can release the keys). There are detailed instructions on resetting the PRAM in Apple's knowledgebase.
Once you've done all of these steps, your display settings should reset to their defaults when you log back in.