Dan Evans recovered from a set down to upset top seed Dominic Thiem in the quarter-finals of the Apia International in Sydney.