If you accidentally run from or kill a legendary Pokemon, all you should need to do is beat the Pokémon League again for it to respawn. The legendaries will continue to respawn after beating the League until you catch them.
Source: Experience with catching legends