The spell that Lockhart was hit with was from Ron's backfiring wand. The spell that Lockhart intended to cast was one that would totally destroy Harry's and Ron's memories. This is what he meant to do:
'The adventure ends here, boys!' he said. 'I shall take a bit of this skin back up to the school, tell them I was too late to save the girl, and that you two tragically lost your minds at the sight of her mangled body. Say goodbye to your memories!'
He raised Ron's Spellotaped wand high over his head and yelled, 'Obliviate!'
Harry Potter and the Chamber of Secrets - p.224 - Bloomsbury - Chapter 17, The Chamber of Secrets
"'Say goodbye to your memories!'" There's no talk of wiping out the last 24 hours or anything like that. "[Y]ou two tragically lost your minds", he's not just gonna do enough to get away with it.
I assumed that this was the way with Obliviate, it was a mind-wiper. But actually it doesn't seem to be.
I don't believe the trio reversed the Memory Charms they performed on the Death Eaters and the waitress - what conceivable reason would they have to put the Charm on them, and then undo it? They reversed the spells they'd used to subdue them so that they could plan their course of action and then perform the charms. However, it does seem to be the case that Rowle and Dolohov's minds weren't as destroyed by Obliviate as Lockhart's was:
'More, Rowle, or shall we end it and feed you to Nagini? Lord Voldemort is not sure that he will forgive this time ... You called me back for this, to tell me that Harry Potter has escaped again? Draco, give Rowle another taste of our displeasure ... do it, or feel my wrath yourself!'
Harry Potter and the Deathly Hallows - p.145 - Bloomsbury - Chapter 10, A Place to Hide
So Rowle certainly seems to be in possession of his faculties and know who he is, and who Voldemort is, and that he was supposed to be on the trail of Harry Potter.
Hermione definitely casts Obliviate, so it's really a matter of speculation as to how the spell works. It may be, as bleh suggests, Lockhart's innate ability with memory charms, and Hermione's inexperience and lack of confidence. Or it may be that it's possible to deliberately control the extent of the spell.
But the point of this answer is Lockhart was on the receiving end of a spell that was intended to destroy his mind and obliterate his memories completely. And that's exactly what it did, cast, as it was, by someone who was very capable.
Rowle and Dolohov don't seem to have been hit by a spell that did destroy their minds and obliterate their memories, whether by Hermione's design, or due to her lack of skill, or due to their strong minds, as compared to Lockhart's rather mediocre one, or some other factor.