This is so old, and I guess they've fixed it in El Capitan. One of the worst bugs I've ever ran into, because once it's triggered you'd struggle to fix it while your screen is upside down, especially if you don't have any peripherals handy. So, here are the steps just in case some unfortunate souls run into this.
* Assuming you're doing this on MacBook, or otherwise you know you're dealing with your main display. If you know better, run fb-rotate without parameters for help message.
- Go to https://github.com/CdLbB/fb-rotate
- Instead of following the instructions at the top to download the source and compile, you might want to scroll down, download the binary and run it directly. There's certainly risk, but your screen is now upside down so.
- Follow the links, download fb-rotateNEW2.zip and extract it.
- Open your favorite terminal such as Terminal.app
- Go to where you've extracted it e.g.
./fb-rotate -d0 -r0
Copy the following single line and paste it into Terminal.app (Note the link and names might change, so if it fails fall back to the manual steps above. If you don't see 'done' at the end of the output it failed):
cd ~/Downloads && curl -LO http://dl.dropbox.com/u/6347985/Modbookish/Downloads/MacFlip/fb-rotateNEW2.zip && unzip fb-rotateNEW2.zip && fb-rotateNEW2/fb-rotate -d0 -r0 && echo done
If you're still getting the display preference pane error:
Open system preferences -> hold option/alt key and click on its dock icon -> force quit -> re-open it
That should fix it.
I managed to find the answer and fixed this like a real engineer, flipping my mbpr one way to type, another way to read, so proud of myself after this. God bless.