So if our planet is doomed to end by asteroid, what can we do? Well, once it has hit there is very little. Best-case scenario you managed to fight your way into a deep underground shelter with enough food and water to last a decade or so until it is safe to return to the surface. There are ways, however, to prevent the asteroid from ever reaching our planet. Given enough advanced warning, there are a few possible methods to curb a collision.
The first would be to blow up the asteroid, whether it be from within like our Asteroids in Hollywood pick Armageddon, or just shooting at it and hoping for the best. However, neither option is likely to be successful as the object would probably just split into smaller, radioactive pieces still bound for Earth.
The second would be to try to nudge the asteroid off its course altogether. We could launch rockets that detonate before reaching the object so that the blast alters the trajectory without damaging the mass, or we could try to land rockets on the surface and give the asteroid a propulsion system of its own.
Our final option would need the most notice and planning. A spacecraft could fly along the asteroid for months or even years gently bumping it every now and then to change its course. If the object is small enough, the gravitational pull from the ship alone may serve to alter its path without ever having to make contact.
Of course, none of these options has been properly or extensively tested, but let us hope that if the need arises, our planet will come together and take action.