In most cases the money stays in the registry until the hearing or trial but the landlord can petition the court to release the rent from the registry. As long as you are in the property the landlord is entitled to rent, the question is whether you are entitled to a credit or reduction in the rent for each month. If you don't have an attorney I suggest you retain one immediately so that you can properly prepare your case for trial.
No attorney-client relationship is created by answering questions in this public forum. If you wish to create an attorney-client relationship, you must contact me directly and sign a representation agreement. Answers are provided based on general ideas and an answer specific to your situation would require a review of all documents.
The judge probably granted the motion of he landlord because your 7 day notice was defective. The notice must be sent by certified mail return receipt requested. No other type of delivery is acceptable. You should consult an experienced real estate lawyer to help you in your dealings with the landlord.
Disclaimer: This answer is provided for informational purposes only, does not constitute legal advice, and does not create an attorney-client relationship. Actual legal advice can only be provided after completing a comprehensive consultation in which all of the relevant facts are discussed and reviewed.