Andersen, who had two other stints at Utah (1997-2002 and 2004-2008), parted ways with Oregon State in October after the Beavers started 1-5.
"We're looking forward to Gary rejoining our staff," Utah coach Kyle Whittingham said in a statement. "Gary brings a wealth of high-level coaching experience to the program, including serving as the head coach at two Power Five schools. During his previous time on our staff, he developed some of the best defensive linemen in Utah history."
Andersen will officially join the staff Jan. 9, when the NCAA starts allowing programs to carry 10 assistant coaches.
"Returning to the Utah football family is something my wife Stacey and I are very excited about," Andersen said. "Having an opportunity to coach at your alma mater is somewhat unusual, and having the opportunity to do it again is certainly special. Kyle Whittingham is a great coach, and I look forward to working alongside him again. I am fired up to meet the players and go to work."
Before the rocky start this season in Corvallis, Anderson signed a contract extension last December through the 2021 season and had more than $12.4 million remaining on the deal, but chose to walk away from the money.
After two years as the coach at Wisconsin, where he went 19-7, Andersen made the surprising jump to OSU before the 2015 season to replace Mike Riley. He inherited a team devoid of talent but seemingly had the program heading in the right direction coming into the season. The Beavers improved from 2-10 in his first season to 4-8 in Year 2.
Andersen was the head coach at Utah State from 2009 to 2012, where he compiled a 26-24 record, including an 11-2 season in his final year that propelled him to the Wisconsin job.