The 24-year-old joined Gillingham on loan in July, but his family failed to settle and he has returned to Brunton Park, where he scored four goals in 16 appearances last season.
"He was one of my main targets," boss Steven Pressley told the club website.
"We're delighted we've got it over the line. He's a really exciting player."
Thomas also spent time on loan with Notts County in League Two last season, scoring once in 29 appearances.