Here are a couple of codes to soft/hard reset/format a Symbian s60 v3 mobile device:
Soft reset code: *#7370#
Hard reset code: *#7780#
If the format code mentioned above is not enough, try the following manual method to hard reset/format Nokia N95 ( I haven't personally tried it yet):
* Turn off the mobile device.
* Press and Hold the following three buttons: the green Call Answer button, the “*” button, and the number “3″ button.
* While holding these buttons, turn on the phone and keep holding the keys untill the mobile phone restarts and prompts you to enter details.
Read the complete s60 v3 code page here.