Dealing with particles via magnetic field was actually the job of the Bussard Collectors (you know, those red glowing things at the front of the nacelles), a.k.a., ramscoops. Which actually didn't deflect it, but collected all that mostly hydrogen in the ship's path.
They were around several years before Star Trek picked up on them: http://en.wikipedia.org/wiki/Bussard_ramjet
For a fairly long time, in the gap between TOS and TNG, when the books were adding to and fleshing out the universe, there was the idea that the vast majority of interstellar hydrogen is antimatter (discovered by Voyager 6 or something like that, when it transmitted back what it found and was promptly annihilated). That was the key thing that allows for travel without having to carry around a ton of reaction mass. Then add dilithium crystals, which were discovered to have a very powerful resonance effect near a matter-antimatter reaction. The discovery was an lab-bench accident, similar to the discovery of X-Rays. Of course, this is back when first contact was between Earth and Alpha Centari, and the Alpha Centariuns (who look like humans, only a bit more stocky and a second opposable thumb instead of a pinky) worked with Earthlings together to discover warp theory. TNG and later canon continuity wiped out most of that, but I haven't seen anything that directly contradicted the "interstellar hydrogen is mostly antimatter" idea.