The only country to have left the UN and then rejoin is Indonesia.
Indonesia withdrew from the United Nations in 1965 in protest of Malaysia's election as a non-permanent member of the Security Council. This departure was a political statement during a period of conflict between the two nations. Indonesia rejoined the UN in 1966 after the political climate had shifted. No other country has left the UN either by choice or expulsion since its founding.