I accidentally connected one of my arduino's I/O pins to 12 volts, the board powered up because of it. After I figured out that i had made the wrong connections I disconnected the power from the board. Ever since then I can't upload any code to the board. So is my Arduino burnt or is it just the microcontroller. would it help if I changed the microcontroller or should i buy a new board.
If it was just I/O pin connected to 12V so yes, just replace the MCU. Raw MCU must be bootloaded. I am supposing you have Arduino UNO.
You can check the board if you are not sure. Remove the MCU and the board must be visible after connection to PC as before (USB device). Connect RX-TX pins and start terminal, what is written - must be read. Eventually check the regulator if not getting hot (have to be connected via barrel jack) and if its voltage is 5V.