In reply to marky:
Rest it within reason for a few days, then gradually ease back in. I've had left-hamstring trouble on/off since tearing it middling-badly while running in the late 1980s, not helped by being tall (6ft8). Has mostly been fine down the years but with quite lengthy spells when it's been less good. My running days have long gone but I'm out on the hills heaps and need to be careful long-striding over streams, crossing stock fences etc. I'm also prone to aggravating it while bending down to pick up stuff - the most recent spell of problems (not currently bad but I'm still aware of it) began on one post-breakfast local legstretch about 18 months ago when I bent down to pick up a can that someone had chucked out of a car, and something "went". Should have bent my knees properly, or - as I now habitually do on morning walks - been carrying one of those litter-picking grabbers around with me.
The good news is that in my experience it settles down fairly quickly - I lose the odd hill day here and there but not weeks at a time. There's also a knack to knowing when to restart - if you wait for it to settle completely and not be something that you can feel at all, then you could leave it forever. Generally I find it's OK to start doing hill stuff again slightly sooner than I think - but there's a need to be careful of rocky or tussocky ground, and particularly downhills where there's a risk of overstriding. Hope that helps, anyway.
(Oh, and I don't do much in the way of formal stretches - have found that those quite often lead to very annoying "injured in the warm-up" tweaks - so instead I prefer to prepare for anything strenuous by going for an easy walk for a mile or so beforehand.)