The 30-year-old Venezuelan slugger spent his first seven Major League Baseball seasons in San Francisco from 2008-2014, winning World Series titles with the Giants in 2010, 2012 and 2014.
He was the 2012 World Series Most Valuable Player while with the Giants, but he struggled since leaving San Francisco and joining the Boston Red Sox as a free agent.
Sandoval signed a five-year, $95 million-contract with Boston after the 2014 season, but was released by the Red Sox on Wednesday when he did not report after being designated for assignment.
Injuries and poor performance plagued Sandoval in Boston. He hit .245 with 10 home runs and 47 runs-batted-in in 2015, played in only three games in 2016, and batted only .212 with four homers and 12 RBIs in 32 games with the Red Sox this season.
Sandoval departed San Francisco amid acrimony in 2014, saying the Giants disrespected him during contract negotiations.
On Saturday, he tried to smooth over any lingering ill-will.
"I have always loved and appreciated the Giants organization, my Giants teammates and the fans of San Francisco," Sandoval said in a statement.
"I have so many great memories and I want to thank the organization for giving me another chance to come back here.
"When I left the Giants in 2014, my comments were emotional, insensitive and misguided and I truly regret and apologize for my actions. I am committed to working hard to contributing to the success of the Giants."