The 32-year-old goalkeeper, who joined the Cherries from Reading in 2015, suffered a knee injury while on international duty with Australia last week.
The extent of the injury is bad enough to force Bournemouth into rescinding the loan, which was initially agreed to run until mid-January.
Forest manager Mark Warburton told reporters: "Adam is having surgery and we have sent him our best wishes over that - but Bournemouth have basically rescinded the loan and taken their player back. That is a magnificent gesture on their part.
"The focus is on the health and wellbeing of the player. He is having surgery to find out the extent of the damage - and action will be taken from there. I would expect nothing less from somebody like Eddie Howe (manager) and Bournemouth in general but I want to say how outstanding they have been in dealing with this.
"We are very thankful about the way they have acted throughout this entire process and I am sure everyone would wish Adam the best of luck with the surgery and a swift and speedy return."
Federici made just two appearances in the Premier League last season.