Neil Lennon’s men came into the fixture on an eight-match unbeaten stretch and looked good value to increase that when Darren Pratley opened the scoring inside the opening minute.
Jacob Butterfield levelled matters just before half-time, while Wells scored five minutes from time for his 10th goal of the season but first since November 1.
His strike sealed Town’s first home win over Bolton since March 1999, but they appeared set for a long afternoon when they found themselves a goal down after just 41 seconds.
Pratley was fouled on the left of midfield by Tommy Smith and when the free-kick was only half cleared, the former Swansea City man pounced in stunning fashion. He lashed a rising effort in off the bar from near the penalty spot to register his third goal of the season.
The Terriers responded well, with defender Murray Wallace twice going close with headers from Butterfield corners.
A Butterfield cross saw Harry Bunn draw a fine save at his near post from Bolton ‘keeper Andy Lonergan, while at the other end, Alex Smithies parried a goal-bound effort from veteran striker Eidur Gudjohnsen.
Wallace nearly gifted Bolton a 2-0 lead when he gifted a pass to Lee Chung-Yong. The Town defence were playing it about at the back when Chung-Yong pounced and fed Feeney, who fired wide from a tight angle.
But the hosts deservedly levelled just before the break, with Butterfield starting and finishing a move down the right in the 43rd minute that also involved Jonathan Hogg and Sean Scannell.
When Hogg passed back to Butterfield, he struck a half-volley from about 20 yards that arrowed into the left corner of the net.
Both sides traded blows early in the second half, with Butterfield testing Lonergan, while Matt Mills had a shot blocked.
Bolton, going for a third successive win after victories over Millwall and Blackburn, brought on Emile Heskey midway through the second half. Pratley made way as the Trotters went for the points, with Heskey and Gudjohnsen, with a combined age of 72, up front.
Heskey then had the ball in the net after being played through by Chung-Yong, but he was ruled offside.
Lonergan tipped over a 25-yard blast from Robinson as Huddersfield turned the screw in a late dominant spell that saw Wells net the winner. Wells drew out Lonergan and fired underneath him on 85 minutes after being put through by Hogg.