The former Manchester City forward joins Mubarak Wakaso, who joined Chinese Super League side Jiangsu Suning, in leaving the Basque in a busy week of transfer activity at the Estadio Menizorroza.
Asier Garitano has already brought in Victor Camarasa and Ismael Gutierrez on loan, and the former Real Sociedad boss is anticipated to make more moves before the transfer window closes at the end of the month.
Guidetti, who arrived at the club ahead of the 2018-19 season, from Celta Vigo, however he has struggled to established himself as a first team regular, with just one La Liga start this season.
He will now head to Germany for the remainder of the 2019-20 season, with no details of a purchase clause included in the deal, as the 27-year old looks to rediscover his form and fitness.