You'd need to produce a huge amount of force just to even slow down the rock/planet/asteroid, never mind turn it around and go the other way.
Generally, all hypothetical solutions to incoming cosmic projectiles involve slightly altering the path said object over the course of many years so it drifts by the earth instead of into it.
Blasting it into chunks is one proposed solution. There are 2 issues with it though.
1) If you use a nuclear device, now you have irradiated debris raining down from the sky.
2) Many of these asteroids consist of tightly packed debris, blasting them apart will just allow them to drift back together again over time.