SAN DIEGO • When the Cardinals moved Shelby Miller to the bullpen around the All-Star break and told the young starter that he needed a breather from the rotation, a chance to rest, Miller remained active by popping in and out of manger Mike Matheny’s office.

Having been removed from the rotation before, famously last October, Miller kept stopping in to ask the questions he was also being asked.

Is it really a rest? Really? Or code for something else?

“I don’t think he had a mental rest,” Matheny said Thursday. “He kept refusing to believe me that we were just giving him a rest. He was driving himself and me both crazy. He (had) to keep trusting the fact we were really trying to help him. He’s looking stronger and more consistent.”

The early successful returns on the rest that really was a rest continued Thursday as Miller threw the Cardinals to a 6-2 victory in the finale of a three-game series against San Diego at Petco Park. Rookie Oscar Taveras homered for the Cardinals’ first runs and Matt Holliday had a two-run single to make a winner of Miller (8-8). Instead of fatiguing late in his start and struggling to keep his mechanics together, Miller maintained his strength and command.

The second-year starter held the Padres to two solo home runs, both in the same inning, and struck out five in six innings. For the second consecutive outing he did not walk a batter.

“I just want to pitch, man,” Miller said of peppering Matheny with questions. “That’s what I do. That’s what I’m here for. To just pitch. There is no doubt that I want to be a starting pitcher and that’s what I’m going to be. Just trying to be the workhorse.”

Toward the end of the first half, Miller’s starts became shorter and shorter and his ability to maintain control less and less. He pitched through recurring stiffness in his back and struggled as a result of a flawed delivery. Where the box score saw a ballooning ERA, the Cardinals saw exhaustion and took him out of rotation for a fortnight. The move coincided with baseball’s trade season, the weeks leading up to Thursday’s non-waiver trade deadline. Miller’s name was tied to potential deals for other starting pitchers by report, and he was a favorite plug-in of rumors.

He acknowledged Thursday that it was “in the back of my head.”

And then that morning it was in front of his face.

As Miller prepared to face the Padres at the end the Cardinals’ six-game road trip, he saw on television that his closest friend on the team, Joe Kelly, had been dealt with outfielder Allen Craig to Boston for righty John Lackey. They had been groomsmen in each other’s weddings last fall. Miller’s voice wobbled as he talked about being in a rotation without Kelly.

“It’s tough seeing ...,” he said. “Tough to see him go.”

The Cardinals’ moves to add Lackey and righty Justin Masterson at the trade deadline had ripple effects throughout the pitching staff and lineup. Carlos Martinez, recently removed from the rotation, could be sent back to Class AAA Memphis to save innings and refine his stuff for September. The Cardinals will find out Monday if Michael Wacha can begin a throwing program that will target his return for September. Wacha’s return as a starter would squeeze one of the other pitchers out of the mix, most likely Miller.

Craig’s departure deeds right field to Taveras, who has seen increased playing time in the past week but hasn’t clicked like the front office imagined when it promoted him June 30.

In his first at-bat as the regular right fielder, Taveras turned on a changeup for his second career homer. Taveras said, through an interpreter, the playing time will help him get “comfortable.” Taveras’ bolt into the right-field seats gave the Cardinals a 2-0 lead and their first runs of the series not scored on an out. The Cardinals had scored three runs total in the previous three games, and the lowest-scoring offense in the majors, San Diego’s, had outscored them 15-2 in two losses this week.

“We needed that shot,” Matheny said. “It’s been talked about ad nauseam about our offense, or lack of. Oscar getting something going is a good shot in the arm for us.”

San Diego tied the game, 2-2, with solo homers by Jedd Gyorko and Will Venable in the second inning. Miller recovered by retiring 13 of the 14 batters after Venable’s homer. In seven of nine innings, the Padres went down in order. Three Cardinals relievers retired all nine they faced.

Holliday broke the tie with a single in the third, and the Cardinals sent eight batters to plate in the sixth to extend the lead.

The Cardinals lost Miller’s final five starts before the break, and he had lost six of his previous seven decisions. From June 14 to July 10, Miller had five starts with at least three walks and three times he allowed four or more runs. After the rest he returned to the rotation last week at Wrigley Field and pitched 5 2/3 innings of a win. Of his 87 pitches, 74 were fastballs in that start. On Thursday he diversified.

“That first-pitch curveball he was getting ahead with. Threw some sliders, cutters,” Matheny said. “He pitched a little bit more. The last start out he let that fastball eat and had success. I think that’s part of pitching and growing — understanding when that’s not necessarily going to be enough that day.”

Before the game, Matheny described the team as “sad” about the trade.

He said his duty was to help redirect the players from the players walking out the door to the game they had on the field. Miller said he felt a new resolve when he saw Kelly leave.

He wanted to stay.

“I’m still a Cardinal and really wouldn’t want to have it any other way,” Miller said. “I want to be that guy, that draft pick, who you hear about how he stayed, how he has a career with one team and does well. There is nothing that I want more than to pitch really well and have this team win and come to our park every day. I want to spend the rest of my career here. That is a true statement.”

Derrick Goold covers the Cardinals and Major League Baseball for The Post-Dispatch. Follow him on Twitter at @dgoold or on Facebook at Facebook.com/BirdLandPD

Derrick Goold is the lead Cardinals beat writer for the St. Louis Post-Dispatch and current president of the Baseball Writers' Association of America.