It’s really surprising how that one move works for just about any problem you can encounter with an iPhone (other than a physical defect in the phone which should be covered by warranty.)
One time I thought the battery had completely died altogether (this is on my iPhone 3G after all) because of a kink in the charging cord which interfered with proper charging.
It took a week or for me to get a replacement cord. After charging overnight, it would turn on briefly and immediately shut down again.
But I kept doing the same move of holding down both buttons even tho it promptly shut down a few seconds later.
I must have done this about a half dozen times or more. And voilĂ , it finally sprang back to life.
It never ceases to amaze me how many times that one simple maneuver has saved my aging phone.
BTW: I doubt your phone was overcharging because Apple has designed it to prevent that.
IF it had been overcharging tho, you should be eligible to have it replaced because that’s a serious defect (Apple’s fault).
Anyhow, glad you got it resolved.