Unlocking is an irreversible event. You can remove all your personal data from your device by Options / Security Options / General Settings / Menu / Wipe Handheld. That will not reload the factory OS if you have changed it. You'll have to do that separately if needed. Unlocking is benign. Why do you want to relock your device?