There are wide variety of possible cosmic collision threats - with only rare once-a-century (or less frequent) size events being candidates for any sort of deflection scheme. More frequent ones we can absorb with minimal damage. The 2013 Chelyabinsk event was a 20 meter class asteroid, and we get hit with a few of these a year. Even a repeat of the Chelyabinsk over a much larger city would not be catastrophic, as a natural catastrophe it might rank as a "major storm" in terms of damage potential.
It is larger asteroids, above the 20 meter size, that are destructive enough to consider an international interception mission.
Barringer Crater in Arizona is an example of a 50 meter object (a once in a millennium event), such an impact would be highly destructive in a populated area. Current collision threat programs have identified 96% of the "civilization ender" 1+ km class objects (once in a million year event), and are moving toward identifying 90% of the 140 meter class (once in 10,000 years).
The ideal method dog dealing with any collision threat is to detect it long in advance, accurately measure its trajectory, and then modify it just enough to avoid a predicted collision years later (perhaps many decades later, even centuries later for really big ones). Smaller objects need smaller nudges and can be diverted at later dates than big ones. An aggressive monitoring system is the first line of defense, without detection there can be no defense, and the better your detection the easier deflection becomes, and the cost of monitoring is much less than a single interception mission.
A variety of nudging techniques have been proposed: kinetic collision diversion, gravity attractor tugs, and nuclear deflection schemes primarily, but all of them are in early stages of development and have some promise. Different deflection schemes might be needed based on the nature of the threat object (size, physical nature, etc.).
Until we have candidate defection systems to evaluate, and actually test, it is way premature to discuss storing nuclear devices for this purpose. Probably storing a ready made device would be of no value. When we detect a threat requiring deflection we would first need to organize the whole launch and space probe project, which would likely take a few years (assuming warning times on the order of decade) during which time a nuclear device customized to the mission could be manufactured as needed. If the world decides (after suitable development and testing) that a ready-to-launch-on-short notice vehicle is a good idea to deal with small threats detected months in advance, and it is determined that a nuclear device is the proper technique, then we would only need one such system to be built and kept ready - with a grand total of one special purpose nuclear device.