Harper batted cleanup and played left field in New York against the Mets. He finished 1-for-4 with a single in the Nationals' 3-0 win.
"Good to be back," he said before batting practice.
Harper is hitting .273 with 19 home runs and 49 RBIs in 101 games. The Nationals are trying to make a late run at an NL wild-card spot, but are running out of time.
The 20-year-old Harper hasn't played since being scratched Saturday at Miami. The two-time All-Star recently went to Washington for a medical checkup.
Harper was the NL Rookie of the Year last season, hitting .270 with 22 home runs and 59 RBIs in 139 games after being promoted from Triple-A in late April.
Like the Nationals, it's been a frustrating year for Harper. After a strong start in the first month, he bruised his side running into the wall at Atlanta. He then hurt his left knee crashing into the fence at Dodger Stadium in mid-May, and later went on the disabled list.
"I mean, it's been a crappy year in that aspect," Harper said after sitting out Tuesday night's 6-3 win over the Mets.
"Hitting the wall and hitting another wall and hitting another wall, it wasn't a lot of fun. Hopefully I won't hit as many walls next year, and maybe I'll learn from that. But that's just the way I play," he said. "Maybe got to mellow it down a little bit and try to play 162 or 150 games and see where I'm at."
Harper started the All-Star Game at Citi Field in July, and has played well during the last month.
Nationals manager Davey Johnson said he liked Harper's aggressive style and didn't want to temper his play. Rather, Johnson hoped Harper would "learn from experience."
"He'll learn that some of these walls aren't padded," Johnson said Wednesday.
Information from The Associated Press was used in this report.