To add to what others have written. I have much more knowledge about US contract law than I do of German. Oral contracts can also be legal is the States but only under very limited circumstances. I think it is much broader in Germany. But here is the problem, and why it this way in the States; how does one prove an oral contract and what is actually agree to?! Rental payments might be verified but other than that, most things are virtually impossible short of having an absolutely credible witness that would make a sworn statement – and even then not for sure. There are often contractual conditions that are assumed by default unless otherwise stated in a contract in Germany. And with lack of proof of having agreed to other conditions, well, good luck with that.
But talking with the landlord is always the place to start. Even if strict conditions might be contractually set, it doesn’t mean that one might not waive their rights. Like having to give 3 months’ notice, which is often standard for an apartment; one could ask to be let out of it due to special circumstance and if the person is nice then they can do it.
Here is another factor. In German law there is the concept of “Höhere Gewalt”, which means an act of god, or something unavoidable for which nobody can be held accountable. I signed contracts to perform for festivals over the coming summer but because the government has forbidden large events until the end of August, the organizers cannot hold them nor be held accountable. I have no legal recourse for compensation. And this would get a bit tricky but I can see where a lawyer would argue that one intended to rent and live in an apartment. But they are physically unable to, due to the crisis and government imposed travel restrictions. This might just make the contract null and void. At least it is a good arguing point to see if a landlord wouldn’t find an acceptable solution voluntarily.
This leads to another factor not necessarily so relevant for this incident but for all readers on this site in general. The German court system is slow and ineffective at the best of times. Forget what one might have heard of German efficiency. Having to sue someone over some months’ rent is not likely to pay off. It can be very expensive, courts costs plus legal fees, and take years. And even when one seems to have an open and shut case, judges can simply decide otherwise. And because things often run contrary to what the laws would seem to dictate, a good number of cases get contended and have to go to a higher court – more time and money spent. My tip is to always have a clear contract that also details how, when and what damages are awarded for non-compliance. Having an agreement on paper really helps avoid future misunderstandings.