With current technology the best option is to blow up nuclear devices next to the asteroid before it gets anywhere near Earth. That small course change becomes a large course change across a 10 or 20 year period. That is why they want to be able to find them years before they get here. A few months is not enough time to be able to change the path enough not to destroy the Earth with current technology. The best bet is a small course change years ahead of time.
Read what I wrote again. That may work for a comet; it may not work for a large asteroid. Nuclear devices simply do not work the same in space as on Earth due to the lack of an Atmosphere. Hence, the explosion is all radiation -- no heat and no blast.
While not impossible, there are serious practical considerations. For example, "near" means something like 20 to 100 meters from the asteroid. Too close and it fractures without course change and too far there is not enough neutron flux to disrupt the asteroid's course.
Just an FYI, but there are over a dozen different types of asteroids out there; everything from dry(no water/ice) dust balls to snowballs(lots of water), all the way up to solid chunks of iron.
Further, the current misconceptions about blowing up asteroids are beyond ridiculous; roughly 3/4 of ALL asteroids out there are mostly in the dust ball/snowball categories, with a small, dense core. Similar to how a gas giant forms, the gravity of the larger, denser object attracts many smaller objects, but because the gravity of the larger object isn't enough to heat the material on impact, the result becomes a sand like cloud of material around the central core.
A nuke detonated against a Dust ball or Snowball type would do two things in quick succession; one, it would instantly melt the loose material around the core into a molten chunk, and two, it would heat the object in such a way that any substances(such as water) in the object that vaporize at those temperatures, would. Now what does all of this sound like? Lava, specifically, lava underwater. The object would be highly porous and brittle; a second explosive(a shaped charge for example) would shatter it into a harmless cloud of debris that would burn up on entry.
For those objects that are more solid, a shaped charge would shatter it, especially if you hit the object with several at once. The only type that is immune to this is the ones that are mostly metal; however they tend to be massive enough to be easy to detect and have the added advantage of very rarely being put on unpredictable orbits. For all intents and purposes, the solar system is too stable to make these dangerous.
If you ever see those idiots claiming that blowing up an asteroid is akin to firing a shotgun blast against the Earth, rather than a single bullet, they forget that a shattered asteroid, far enough away, allows the majority of its mass to avoid the target in question; and what they also forget is a smaller object has a larger surface area to mass ratio, which means more of it burns up in the atmosphere.
I will say one thing for those who are planning the asteroid defense strategies: they are smart, but they forget that over thinking things is often more dangerous than the asteroid in question ever could be.