Stock markets had dived earlier in the week as investors fretted over falling oil prices and prospects for China's economy.