Hi -- if you accidentally add code to your form with qRules injected, InfoPath basically assumes that the code you've just created is the code you want to use. Simply close your template and re-inject.
To completely remove, take the steps you already did to accidentally remove the code module -- click Edit Form Code to open the editor, then Remove Code to remove all code. Remove the qRules data connections. Remove the resource file for qRules that is injected.