From Apple (it's the same to unlock):
"Lock the screen orientation.
Double-click the Home button to bring up the multitasking interface, then swipe from left to right. Now tap the portrait orientation lock once to turn it on and again to turn it off."