If you disconnect it from the batt for long enough it will reset it self anyway.
If you change the headgasket then I would assume you do as it is a self learning ecu (cheaper than prefixed ones apparently) so will get confused as the compression ratio will have changed I reckon.
Consult haynes manual for how to reset it properly, if you need to atall.
ecu will settle down after 15 minuets of driving, dont forget you will lose your radio code, so if you dont have it buy a code saver about £5 from car parts shops.