As I see there's 2-3 times this could happen
1: In the War of Spanish Succession, here the Autrians could pretty much get away with confiscate Bavaria.
2: War of Bavarian Succession
3: If the French Revolution are avoided or defeated in 1799 with the new Bavarian Succession crisis.
I think 2 would be the best, the POD could either be that Maria Theresa died early or that she supported her son's attempt to gain Bavaria.
In case number one we see a bigger and bloodier War of Bavarian Succession.
In case number two, we see better diplomacy behind the attempt to gain Bavaria. We likely see Bavaria plus Jülich-Berg traded for the Austrian Netherlands, which are raised to kingdom status. The Austrians gives up Jülich-Berg to the Prussians against them recognise Austrian annexation of Bavaria. The Habsburg also recognise any future sale/annexation of Ansbach-Bayreuth to Prussia. Saxony get bribedby the Habsburg supporting one of their princes becoming prince-bishops of one of the major prince-bishoprics.
So no War of Austrian Succession. So what do this mean for the reign of Joseph II, well his reforms get a lot easier, while he still have to deal with OTL revolts, not having to move soldiers to the Austrian Netherlands make it easier for him to put them down. Also Bavaria are pretty lousy area to revolt in, so it's likely a relative peaceful area. So in general I see himforcing his reforms down into the throats of his subjects. This means that Austria will be a relative unitarian state moving into the 1790ties. He's also less likely to start a war with the Turks, so Austria don't have that disaster. His land reforms will remove power from the Hungarian and Galician nobility and his ecclessial reforms will likely create a kind of Austrian Catholic Church. While the peasants was unhappy over the latter, his land reforms will likely be very popular in the 1790ties, when the peasantry see the effects, which makes a new uprising hard. His ecclessial reforms which includes making the clergy civil servants and removing celibacy, will help benefit Austria in the 19th century, as it strengthen the state but also help create academic families (in Lutheran countries the priestly family produced a lot of lawyers and other civil servants). The push of German as the official language will push for more widespread use of German and help creating a kind of Austrian nationalism for the entire empire. The survival of Joseph for longer will also help Leopold II alive in Italy, Leopold was pretty competent and would likely do a lot to keep the French out, but moreso it would keep Francis II away from the throne a little longer, and if he see his uncle having success with his liberal policies, there's a good chance that Francis will stay more liberal (as he was in his youth, before he saw his uncle's failures and spend 23 years fighting the forces of liberalism).