SAN FRANCISCO (AP) - Tim Lincecum needed a psychological boost. When he got it, his fastball command returned.
Lincecum struck out 12 in seven superb innings, helping the San Francisco Giants beat the Minnesota Twins 2-1 Thursday.
"I wasn't worried about what would happen when I threw pitches," said the two-time Cy Young Award winner. "It was just confidence. Early in the game, when I was commanding the zone, I just opened my mind to be that much more confident."
Miguel Tejada and Cody Ross drove in runs for the Giants, who won their second straight following a season-long five-game skid.
Michael Cuddyer extended his hitting streak to 12 games with three hits and RBI for Minnesota, which lost its second in a row after a season-best eight-game win streak. The Twins are 15-4 since their last losing rut.
Lincecum (6-6) rebounded from a rash of poor starts. He gave up three hits, walked two and never allowed a runner past second base.
"Even when I threw a bullpen I wanted to have belief in myself," Lincecum said. "I wanted that to carry over into games. I was executing my pitches and believing in what I threw at the moment."
Javier Lopez pitched the eighth and Brian Wilson got three outs, despite allowing his first run in 15 1-3 innings, for his 21st save in 23 chances.
Brian Duensing (4-7) allowed just his sixth earned run in his last 22 2-3 innings. He yielded six hits, walked two and struck out five.
"A very good pitching matchup," Twins' manager Ron Gardenhire said. "They just pitched a little better. That's the Duensing we were looking for. He was consistent and has good stuff."
Lincecum entered the game with the worst NL ERA (7.59) in June. He threw 72 of his 109 pitches for strikes in one of his most effective starts. He won for the first time since May 27.
"Timmy was outstanding," Giants' manager Bruce Bochy said. "It was good to see him back on track. He was comfortable throwing any pitch and he had good rhythm."
The Giants opened the scoring in the second inning. Pablo Sandoval singled with one out and Pat Burrell followed with a double. Sandoval scored on Tejada's infield groundout.
Duensing and reliever Alex Burnett got the Twins out of a tight spot in the seventh. The Giants had runners on first and third with no outs and failed to score after pinch-runner Emmanuel Burriss was caught trying to score on a safety squeeze and pinch-hitter Nate Schierholtz grounded sharply to second with the infield in.
"That guy was filthy," Duensing said of Lincecum. "That's how you win Cy Young awards. He has really good stuff, gets ahead in the count a lot and made us chase a lot."
Burnett hit Aaron Rowand with a pitch but then got Bill Hall to fly out.
Ross added an RBI single in the eighth against Glen Perkins.
NOTES: Bochy said there would "be a little bias" when it came to All-Star roster additions when asked about RHP Ryan Vogelsong. ... The Twins activated RHP Joe Nathan after the game and plan to activate INF Jim Thome. RHP Jim Hoey was optioned to Triple-A Rochester to make room. ... Giants OF Andres Torres and SS Brandon Crawford were given the day off and both are likely to start Friday. ... Twins C Joe Mauer (sore back) and INF Tsuyoshi Nishioka (sore hamstring) were held out of the starting lineup. They both pinch hit. ... Giants INF Mike Fontenot (right groin strain) could start a rehab assignment this weekend. ... Twins OF Denard Span (concussion) may start hitting again when the team arrives in Milwaukee. ... Cuddyer has eight doubles over his last 12 games.