Replacing microcontrollers

So, looks like i've accidentaly fried my arduino uno, by working with stripped wires near connected controller

Some time after, while disassembling my broken soldering station i found two microcontrollers: one
1312 ATMEGA8A-PU and another 1306 ATMEGA8L-8PU

Is there a way to make one og them work in place of old arduino uno controller? Is that just a matter of selecting a right board in arduino software?

Tools > Board > Arduino NG or older does have a Tools > Processor > ATmega8 option. I would actually recommend instead using MiniCore:

If you want to upload to your board via the USB cable you need to burn the bootloader to the ATmega8. That will require an ISP programmer. If you don't have a dedicated programmer you can make an "Arduino as ISP" out of a spare Arduino board. MiniCore provides a bootloader that frees up 0.5 kB more program memory than the bootloader of the Arduino NG or older board, which is one of the reasons I recommend MiniCore. When you only have 8 kB program memory total 0.5 kB really matters!