So, when you generate a project with robot builder, it should give you comments along the lines of:
Code:
//START ROBOTBUILDER
and //END ROBOTBUILDER
Anything between these two comments will be overwritten when you regenerate with Robotbuilder. If it is deleting code in other locations, then this is a bug.