Flashing ATmega8U2 using another Arduino
There is an official guide. Arduino as ISP and Arduino Bootloaders

But you need to add the 2x3 ISP pin header since some of the signals isn't available on D0-D13 or any other pins.