This is a temporary order which was made while the court continues to hear a case filed by a schoolgirl.
According to the Nyasa Times news website, the management of the school asked the schoolgirl to cut off her dreadlocks.
The judge, however, asked the school to allow the girl to come to school and offer extra classes to make up for the days she made.
The case is still ongoing.
In Malawi, Rastafarians have been accusing the government of discrimination.
The Rastafarian community protested against the denial of admission to students with dreadlocks in November 2018.