Justinian held a strict policy during his restoration wars that the people within the lands taken were not to be treated as conquests for looting/plunder, but as a return of the Roman Empire, to be seen by the people as liberators instead of conquerors. This worked earlier in Africa where the people of Carthage were treated as if they never lost their citizenship to Rome and were readmitted back into the Imperial system.
Rome itself was a bit trickier with Pope Silverius in nominal control of the city and largely autonomous from the Ostrogoths. Justinian and Silverius traded correspondence in order to gain the Pope's permission for Belisarius and his troops to be admitted to the city with his blessing, as to avoid a battle entirely and instead be welcomed in. The Pope accepted this and welcomed Roman troops into the city and proclaimed a return to imperial rule. Again, the citizens of Rome were treated as nominal citizens of the empire and were treated well.
The time where the situation almost broke down was during the Ostrogothic siege of Rome, where 30,000 Ostrogoths laid siege to the city where Belisarius only had 5,000 men to defend the city. When faced with this, he had to make a risky decision to press the citizens into military service to help bolster his manpower as well as keep the rest of the civilian population properly fed as to avoid hunger revolts. Belisarius solved both problems by making makeshift mills using tied boats on the Tiber River to keep churning grain inside the city walls to avoid starvation, and he took thousands of civilians in Rome and pressed them into the army, but provided a soldiers pay to them to avoid dissent in this conscripted force.
Belisarius won the siege and the confidence of the people of Rome was behind Justinian. Rome would trade hands back and forth throughout the Gothic War but by the end of it, Rome was loyal to the Eastern Emperor for the next 200 years, where it was eventually handed to the Pope in 754, where the Papal States took its place.
If you want further reading into Justinian's reconquest of Italy, Procopius' Del Bello Gothico is your best primary source. as well as a wonderful source I'll list here:
Bury, John Bagnell. History of the Later Roman Empire Vols. I & II. Macmillan & Co., Ltd. (1923)