can I restore the bootloader after installing freeRTOS?

If you're just doing a normal upload over the USB cable of your Arduino boards then it will not affect the bootloader. If you are using an ISP programmer to do an "Upload Using Programmer" then the bootloader is erased but you only need to connect the ISP programmer and do a Tools > Burn Bootloader to replace it.