The "best" way is to replace the 4-pin header by soldering in a new one or with a new motherboard. The most expedient way is to bypass it by directly soldering the wires to where the header used to be.
After all, you have a burned up 4-pin header so the motherboard is trash, and a burned-up PSU plug so the PSU is trash, so why not solder them together and continue to use them for however long either will last for? Those connectors have a surprisingly low number of rated insertion cycles (like 25!) so soldering would be way more reliable.
If you are lazy and willing to risk burning it again (which is more likely as it's been burnt before and carbon residue has higher resistance), well the quick and dirty way would be to release the pins for the black wires out of their plugs and swap them around so unmelted ones fit in the header. Just make sure not to mix up where the yellow and the black wires go.