The court on Thursday ordered that the city reconstruct the demolished structures, spokesperson Claire Martens said in a statement.
The city was taken to court after its anti-land invasion unit carried out raids and demolished more than 100 structures.
Martens said some of the structures had been erected since August last year and constituted "people’s homes".
The city claimed it only demolished structures erected recently and left the long-standing ones.
On 10 January, the city and the owner of the land launched an application to prevent further incursions on the property, and were granted urgent relief.
"The occupiers... believed the demolitions to be unconstitutional and unlawful and approached the LRC for assistance," said Martens.
The LRC launched a counter-application on 13 January for an order directing the city to rebuild the structures demolished and interdicting the city from any further demolitions.
The city argued that all the structures demolished by the unit were unoccupied and vacant.
The court rejected the city's argument that it was entitled to demolish structures without a court order if it deemed the structures were unoccupied.
The court restricted further demolitions without a court order.