If you find your screen resolution suddenly drops too 800×600 on Ubuntu 12.04, the following set of commands may help you resolve it. First, stop the graphical environment.
sudo service lightdm stop
Now remove all the Nvidia packages and reboot the system.
sudo apt-get purge nvidia* sudo reboot
This will reset you to the default video driver. You now need to reinstall the Nvidia driver, which you can do by going to System settings > Additional Drivers and selecting the top option with the following name.
NVIDIA binary Xorg driver, kernal module and VPDAU library
Select this and click activate. Now reboot your system again and the Nvidia drivers will be re-installed and hopefully working again.