Move the tool shelf panel to the other side? I somehow managed to flip the T Tool Shelf panel from the left side of the 3D viewport to the right side so it sits next to the N Properties panel.

How did I manage to do this and how do I move it back?
Move the mouse over the Tool Shelf and press F5. This can also be done with the Properties sidebar and headers.