Lets go to the extreme case so that we can think about what the filter does.
Lets take an arbitrary image and then try to reconstruct what the image would have been if there was an R72 filter on the camera.
These are IR longpass filters.
You really can't take what the sensor recorded and backwards from there to try to reconstruct the actual wavelengths (or polarization) of the light that went through the lens.
If you could, everyone would be doing IR photography and UV photography without filters at all. The thing is, once you've hit the sensor you've lost some of the information about the light.
Light itself isn't
RGB its an entire range of various wavelengths for which the summation of that is something that our eye perceives as color. With a colored filter, you are able to reduce the significance of certain parts of that spectra to either balance out the light (as in the case of correcting for UV light), or remove specific parts of it to achieve a specific purpose.
That remove specific parts is one that you can often see. My favorite is the didymium filter (aka Red Enhancer) which has a transmission spectra that looks like:
That drop at 580nm is around the sodium line (think those yellow street lights) and used for safety glasses for a glass blower so that they can remove the the sodium yellow color in the flame and see the stuff they are working with more clearly.
In photography, the brown fall color leaves aren't brown, they're red, and orange, and yellow and a bunch of other wavelengths. By removing some of the wavelengths near red, the red color comes through more clearly.
image from http://photoframd.com/2010/10/15/enhance-fall-colors-with-an-intensifier-filter/
You can find similar filters in astrophotography. A 'skyglow' filter to help reduce specific forms of light pollution in the night sky (some use the didymium filter because it cuts out some of the light pollution from a sodium vapor lamp (note that a mercury vapor lamp is much harder to deal with). (see Types of Lamp for more info on this). Alternatively, you might want to just photograph the hydrogen alpha line that only lets in 7nm of bandpass around 656.3nm. Again, these are things that cannot be reconstructed after the fact once the image has been captured.
Gels, and color correcting filters are ones that only allow the light that you want to photograph through to your sensor. Once the entire spectrum of light is collapsed to an RGB value, you cannot pull it apart again to remove specific parts.