The US Civil War comes to mind, because one man's hated invaders could be another's celebrated liberators. Or, to put it in plain terms, the Union Army during the Civil War was greeted and celebrated as liberators by the enslaved and by Unionists, who were opposed to the Confederacy and saw these Yankee soldiers as men bringing deliverance from the domination, both political and physical, of the Southern slaveholders.
Now, first, a disclaimer about the specific circumstances of the Civil War. In a sense, you could say that this was a "military operation intended to reclaim occupied territory". This was at least the position taken by Lincoln and most Northerners, who asserted that the Confederacy was not a legal entity but rather an insurrection of individuals. These individuals, subverting the will of a secret Unionist majority, had "hijacked" the government of the Southern states. The Civil War was then about defeating these insurgents and putting the loyal people in charge. This doctrine informed the legal and political position of the Lincoln administration and would have profound effects during Reconstruction.
But in reality the Confederacy was an actual government, with an army and effective control over a territory. Its legal and democratic legitimacy can still be contested, because even if a large majority of the Confederate population supported secession and wished for the Confederacy to succeed, a regime based on perpetuating slavery over a large part of its population is inherently evil and undemocratic. But the question of popular support for the Confederacy, the right of secession, and questions regarding democracy and self-determination are outside the scope of this question. Entire books could and have been written about these topics.
The important matter is that for a majority of White Southerners the Confederacy was a legitimate government and Lincoln moving troops in to assert the authority of the United States government was an hostile invasion by a foreign power. Their constitutional theory was that the Southern states had the right to secede from the Union at any point since the Union was based on their consent. Having decided to withdraw that consent to protect slavery, the South was now not under the authority of the United States and Lincoln was violating the territorial integrity of their new country.
These people did not greet the Yankees as liberators. Southern rhetoric always played upon themes of the Union Army as invaders who came down South to spread devastation, death and Black liberation across the land. The idea that there was a secret Unionist majority quickly proved to be a fond delusion on the part of the Union's leaders, as they discovered that the Confederacy, at least initially, enjoyed enormous popular support. From Dixie boys rushing to the banner to civilians who threw chamber pots on the heads of Union occupiers to guerrillas fed and sheltered by their supporters in the countryside, the Confederates very much saw the Union Army as invaders and resented their presence. Even as popular support for the Confederacy waned due to military defeats and war-time privations, you would not see any Southerners greeting the Union troops as liberators.
You would not see any pro-secession White Southerners doing that, that is. Throughout the South, but mostly concentrated in the mountainous areas with few slaves that resented the planter aristocracy since before the war, there were pockets of Unionists. Now, defining Unionism was difficult. Alexander Stephens, the Vice-President of the Confederacy and thus one of the most prominent rebels, had the gall to claim to be part of Georgia's "Union element" after the war. But let's talk about true Unionists, people who opposed secession, hated the Confederacy and denied its legitimacy, and wished for the Union to succeed, often enlisting in the Union Army or finding ways to aid the Northern war effort and sabotage the Southern one. These people saw the Confederate Army as the real oppressors, and they indeed received the Union Army as liberators whenever they took the areas they lived in, ousted the rebels and reestablished the authority of the United States.
For example, take West Virginia, whose population had long resented the domination of Virginia's eastern slaveholders and voted against secession by close to a 3 to 1 margin. Since it was part of Virginia at the time of secession, the region was now part of the Confederacy, but the people there didn't see it as a legitimate government. "The feeling in nearly all of our counties is very bitter" towards the Confederacy, a pro-secession major said, while former governor turned general Henry Wise claimed that West Virginia was "full of . . . traitors" who "invite the enemy, feed him, and he arms and drills them . . . A spy on every top, at every cabin."
West Virginians, by and large, wished for the reestablishment of the national authority, one reporting to Lincoln that they "want to see secession put down and the leaders hung." When General McClellan advanced into the area, the movement was seen as an invasion by the Confederates, including General Lee, who failed to stop McClellan, earning him a reputation for cowardly retreating (funny how things work out). But West Virginians saw McClellan and the Union Army as bringers of deliverance,, cheering and celebrating his victory. "The feeling of the people here is most excellent," McClellan summarized, "We are welcomed wherever our men go." Backed by Union arms, West Virginia would secede from Virginia and form its own state.
The situation was similar in East Tennessee, where a 2 to 1 majority voted against secession and now opposed, sometimes violently, the authority of the Confederacy. “The whole country is now in a state of rebellion,” a Confederate colonel reported, while a newspaper said a civil war within the Civil War had started. An attempt to start an armed uprising and rejoin the Union failed because General Sherman had a nervous breakdown (funny how things work out) and the Unionists were severely repressed, many hung or jailed. Richmond was forced to keep 4 to 5 thousand troops in the area to quiet down Unionism, General Kirby Smith complaining that operating in East Tennessee was “more difficult to operate in than the country of an acknowledged enemy."
In September, 1863, Union forces liberated East Tennessee, being received amid cheers and celebrations by Unionists who saw them as liberators. Colonel Foster reported from Knoxville that “Men, women, and children rushed to the streets". The women “shouting, ‘Glory! Glory!’ ‘The Lord be praised!’ ‘Our Savior’s come!’", the men "huzzahed and yelled like madmen, and in their profusion of greetings I was almost pulled from my horse", and throughout the city "the streets resounded with yells, and cheers for the ‘Union’ and ‘Lincoln.’" General Joseph J. Reynolds was amazed when a group of Unionists, hidden in the mountains from the rebel authorities, saw his forces and “joined our column, expressing the greatest delight at our coming, and at beholding again what they emphatically called ‘our flag.’"
Similar references to overjoyed Unionists receiving the Union Army with cheerful cries can be found elsewhere. The famous "Marching to Georgia" has a verse about "Union men who wept with joyful tears, When they saw the honored flag they had not seen for years." But aside from White Union there was another group that received the Union troops as liberators - the enslaved. Even since the start of the war the enslaved well understood that the Union Army represented a chance at freedom, because even if at first they didn't follow a policy of emancipation they may well shelter and aid them in emancipating themselves. As the war developed the Union anti-slavery position solidified, first shown in allowing "contrabands" to enter their camps, then declaring those contrabands free and prohibiting their return, and culminating in the Emancipation Proclamation making the liberation of slaves in areas in rebellion official policy.
As a result, when they learned that the Union Army would free them, the enslaved flocked to their banners and wildly celebrated the arrival of the boys in blue. That was the case in Georgia, where despite General Sherman's racism and apathy, the enslaved rushed to his army and cheered them on. That was, too, the case in Richmond, towards the end of the war, where joyful freedmen greeted the Union Army and the visiting Lincoln with cries of "glory hallelujah". They were not passive either, just waiting for them, for the enslaved offered aid, intelligence and information when they could. Such overt enthusiasm and direct assistance wasn't always safe, for the Union Army could be driven away and the result was re-enslavement and repression, and the Confederates had their own policies aimed at maintaining slavery. But whenever the Union Army came, bringing with it liberation from slavery, the enslaved were quick to greet them as liberators.