Some time back I installed Ubuntu 10.04 and I did not like the new button layout. I wanted to move it back from the left hand upper corner to right hand upper corner. I recently discovered the gconftool-2 tool to do the same.
Gconftool-2 is a command line configuration editing tool, similar to regedit on Windows. The tool allows you to get existing key values or set new ones. For additional help try:
Run the following command and you would be back to original layout.
gconftool-2 -s /apps/metacity/general/button_layout -t string ':minimize,maximize,close'