You can do a factory reset through iTunes:
“1.Connect your iOS device to your computer and open iTunes. If you don't have a computer, borrow one from a friend, or go to an Apple Retail Store or Apple Authorized Service Provider.
2.While your device is connected, force restart it: Press and hold the Sleep/Wake and Home buttons at the same time. Don't let go when you see the Apple logo — keep holding until you see the recovery mode screen.
3.When you see the option to Restore or Update, choose Restore.
iTunes will download software for your device. If it takes more than 15 minutes, your device will exit recovery mode and you'll need to repeat steps 2 and 3.
4.Wait for the process to finish. Then you can set up and use your device.”