Jailbroken and Unlocked question

If a iphone is jailbroken and unlocked will a master reset undo these things ?

I dont have any need for them and may be buying a phone that is both jailbroken and unlocked.

I have a valid ATT account so would prefer the phone to be factory set
Just connect to iTunes and restore it, that will clear it.
Master reset will not undo the jailbreak, it will simply erase all the content you've put on the phone and reset the settings you've made and customized within the phone's apps. Like sting7k said, restore in iTunes back to startup screen.

Original thread: https://forums.imore.com/threads/jailbroken-and-unlocked-question.205216/