raw is not the same as image files like bitmap, tiff, jpg, etc - it cannot be altered or saved over. all that you are changing when 'editing' them is how that particular software will render/read the data contained in the file in order to present a recognisable image. as stated before this information is recorded by the software itself in a separate location, not in the raw file data.
if you open the same raw file in one software after making edits in another, the original file will open unchanged, in spite of anything else you have already done in the other program
this is why, when i am finished processing a shoot in lightroom, i will export all my edit settings for the whole shoot to a single catalog file, in order to preserve the processing after i have removed the folder of raw files from my main lightroom catalog. if i ever want to recover my work or change some settings, i just re-import that exported data file (which i store in the same folder as the raw files for that day), and all the edits i made previously are reloaded. otherwise, if i just re-imported the raw files themselves, i would be forced to start over from scratch.
if you make mistakes in processing a raw file and wish to start again just revert the settings to their original state, or use the history palette to undo as many steps as you wish.
once exported to a regular image file like jpg etc, THEN you have to be careful about working on a copy or making a duplicate layer with your original export preserved. but, the raw will always be just as shot.