I'm pretty sure apple would be able to tell you've jailbroken the device, even though the 'Restore' installs a fresh firmware again.
Apple have diagnostic tools that are used behind the counter... but who know's what they actually do.
In basic, to remove the 'unlock' simply hit the restore button and download the latest FW and your totally back to stock (straight from the factory).
__________________
32gb iPhone 3GS 3.1.2 JB via Blackra1n
8gb iPhone 3G 3.1.2 JB
-John
|