How one Royal Navy officer helped return stricken ship to action