Is there a lock symbol at the top of the iPad's screen next to the battery indicator ? If there is, then depending on what you've got Settings > General > Use Side Switch To set to (rotation lock or mute notifications), then you can lock/unlock the rotation by the switch on the right hand side of the iPad above the volume switch, or via control centre : swipe up from the bottom edge of the screen and it's the right-most of the 5 icons in the middle of it (if the icon is white then it's 'on', tap it to turn it grey and 'off'). The function that isn't on the side switch is set via control centre instead : http://support.apple.com/kb/HT4085
If there isn't a lock symbol then try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.
Had this exact scenario - literally overnight my rotation lock stuck in portrait mode on my iPad2.
I rebooted, reset, restored, etc.; waited 18 hours to talk to an Apple genius at the Apple store who then told me that if none of this worked it must be an accelerometer problem and (since I'm out of warranty) the best he could do is take a couple hundred $'s off the price of a new one. I passed on that and went across the hall to the Microsoft store, where I ordered a Surface 2.
In case the Apple s/w designers are reading this, I have a suggestion: provide a means to lock the screen and then manually rotate it. The accelerometer is a cool feature, but if it breaks, the iPad loses a ton of value. This is basic fault tolerance, and your designs are generally so good I'm surprised that this isn't available.
Solution: I eventually let the IPad completely discharge, left it off the charger for a few hours, then completely recharged it overnight. Rotation is currently working properly. FWIW - the iPad had about a 40% charge when the accelerometer originally failed.
If your accelerometer will not reset there is a fix that will allow manual screen rotation.
In Settings-General-Accessibility, activate Assistive Touch.
A square with a circle in it should appear on the screen. This square can be moved anywhere on the screen whenever you choose by placing your finger on the square until it turns black and then while continuing to hold, move it to the desired location.
Tapping once on this opens a larger square with options to choose.
Selecting Device provides several options, one of which is Rotate Screen. This has saved me several years of life I'm sure.
The neat thing is that in each app you use, if you tap on the Assistive Touch icon to set the orientation to landscape or portrait and use it to also lock the screen in the desired orientation, the chosen orientation is saved for the specific app you set it in and leaves all other apps unaffected.
I have been using this since my seven year old's husky friend sat on my ipad while building Legos. Somehow he didn't cause any noticeable external damage but did however manage to apply enough pressure to lodge the teeny bearing inside the accelerometer in some tight corner.