"I'm delighted to be returning to Aberdeen," the 25 year old told the Dons' official website.
"I know the club, the manager and the players well so it's going to be an easy transition for me."
The former Scotland Under-21 player began his career at Motherwell before moving to Wednesday in 2011.
"I was desperate to get my future resolved and when it was made clear I wouldn't be part of the manager's plans at Sheffield Wednesday my thoughts turned to the possibility of returning to Aberdeen," he added.
"It's great to be back at Pittodrie where I feel wanted and I just can't wait to get my season started."