Landlord is refusing to return my deposit

I shared the flat with three of my flatmates. One of them was going to leave by the end of March and a new girl was supposed to come. But, due to the lockdown two of my flatmates couldn't come back home and the colony did not allow any new tenants to move in. For the month of April our landlord reduced our rent from INR 18000 to INR 15000. Our agreement got over on the 15th of May, 2020. For the month of June I requested my landlord if I could continue staying by paying half the rent because the colony was still not allowing new tenants to move in. We had mutually agreed that I would pay INR 9500 and stay for the month of June. Now when we are for our deposit back, that is INR 40000 he is refusing to give it. INR 8300 will be deducted for my flatmate's rent for the month of May. We asked him to return INR 31700. He is asking for INR 3000 of April (which we have said okay to) and INR 9000 for the month of June. Please let me know what can be done. This has been going on for a while now.