If you have a backup from before the phone was jailbroken, you can restore to that, otherwise you must restore as new.
A backup contains configuration files, some of which are modified or created when jailbreaking and therefore can provide evidence of jailbreaking.
If you want your iDevice "100% unjailbroken" for your own purposes, just restore and use your backup. If you're super scared that Apple is going to check if it's been jailbroken (which they don't, in my experience), you can't restore from a backup made while jailbroken.