How to program PIC 12F629 internal oscilator in C?
In order to choose for internal oscillator in MPLAB X go to window\PIC memory views\configuration bits 

in the row of the FOSC choose one of the INTOSC options and any other configuration you would like

press on the "Generate Source Code to Output" button

copy the text you received to the top of the main.c file

If you see the text you copied displayed as errors don't mind it, it is a known bug in MPLAB X

I never worked with pic12f629  using MPLAB X but basically if you don't erase the entire PIC your OSCCAL will be saved. OSCCAL corruption can also happen if your programing fails (e.g. bad connection during programing). if that happend you should use user2320835 advice and use the XC8 linker option

If i were you i would also try to check for the basic examples found on microchip.com, it will be a very good start