South Korea's stock market staged its sharpest reversal on record on Friday, capping a month of wild swings.