The 25-year-old centre-back sustained a cruciate knee ligament injury playing against Borussia Dortmund in December 2012, before suffering a relapse in May 2013.
Badstuber returned to action during Bayern's pre-season campaign, before featuring for 79 minutes in Sunday's comfortable 4-1 victory over German third-tier side Preussen Munster as his side started their DFB-Pokal defence.
And the Germany international reflected on a positive day all around.
"I'm delighted I got to play, I really enjoyed it and we won, so it's been a good day," he told the club's official website.
"We always had it under control today and we can go home with a good feeling."
On Twitter, Badstuber expressed his delight at returning, posting: "First game. Done! Thankful to be back on the field... It is simply the best!"
Mario Gotze, Thomas Muller, David Alaba and Claudio Pizarro were all on target at the Preussen-Stadion and head coach Pep Guardiola will now prepare Bayern for the start of their Bundesliga defence, which begins at home to Wolfsburg on Friday.
Get the best features, fun and footballing frolics straight to your inbox every week.