I was just messaging with a guy on youtube about "loss of cohesion"...you know, when you are playing a song, maybe one you know exceptionally well and have been playing it for 5 years, and still you'll be midway through and you completely lose the plot and basically have to stop and start again. Possibly the most embarrassing thing you can do as a guitarist eh?
I don't think loss of cohesion can be prevented. Guys like Tommy Emmanuel can simply launch into some default "recovering" improvised thing, then eventually get back on track and people will never even noticed he fluffed it. I used to occasionally terminally brain fart and basically have to start over again but these days worst case is having to stop and replay from the last key section. Most of the time if I fluff it I can sort of strum some nonsense and reconnect back to where I should be without dropping the beat, but it is still obvious that I've lost cohesion. I've got a long way to go before I can fudge past it like The Greats can; I think that requires an extensive knowledge of music theory and being well practised in improvisation.
I think getting over losing cohesion isn't about practising to death note for note, it is more about learning what to do when you _do_ lose cohesion. So, when practising if I lose cohesion I don't stop and restart, I keep going maybe strum the current chord or do some percussive slaps, at least keep a bass note alive, but keep on beat and meet up at the next key intersection. For this reason if I am going to start playing a song I already know quite well, I will _always_ play it from start to finish, irrespective of whether I botched it midway through. The more you botch it, the more you will learn what to do to "play through".
We will always botch it. The important bit is how you recover.
As for miss-struck notes or fret buzzing or some other awful single note mistake - well that's a different matter. At least you can play through that without missing a beat ;)