I'm pretty sure I have now undeleted almost every thread that was accidently deleted.
I may have missed a couple, and if you are aware of any please let me know.
Everyone's post counts should be back to almost normal, although there will almost certainly be a few casulty posts, sorry about that.
The recovery from my goof was not 100%, but should be pretty darn close.
Thanks to gnif for a late night backup recovery and writing some script to fix some things.
Sorry to everyone for the goof up, it was entirely my fault
Although having said that, I do believe it was ultimately caused by forum bug.
For those interested, I thought I'd be clever and search for keywords from a particular user which allowed me to mass delete posts 50 at a time (at request of the owner).
So although I was selecting individual posts from a user, the forum decided to delete the entire thread that contained that post. And I didn't realise this until someone posted that thread asking why their post count had dropped 5% or something.