Critical upgrades have been completed on a Royal Navy destroyer which has spent several years on the side-lines.