I need to go back to my country of origin

Good day I'm a nurse from southafrica I signed a 2 year contract in august .I have resigned within my 3mmth probation period now my employer will not let me return back to my country and they hold my passport please help

Only way is a complaint at labor court as well as your Embassy.