I have a not-jailbroken iPhone 4s with iOS 6.1.3 and I wanted to reset settings but I had forgotten the password or maybe I needed restriction code but had forgotten restriction password. I was wriggling out of discussions at :
till I found solution.
What you need is a software called as ibackupbot.
1). Take a backup of your iPhone.
2). Quit the iTunes
3). Import the backup via ibackupbot and open the most recent backup that you just backuped
4). Opened the file: Library/Preferences/com.apple.springboard.plist via ibackupbot
5). Go through the fill till you find the key countryCode. After </dict> add the SBParentalControlsPIN, see below
6). Close ibackupbot
7). Open iTunes and restore the backup.
8). Go to Restrictions, give 1234 to disable restrictions.
9). Go to Reset Settings and give iPhone password and bingo, all settings reset.
Note: Earlier I tried to restore it via ibackupbot, but this time I restored it via iTunes and it worked! phew!
It worked for me but I cannot take guarantee if you screw up somewhere