25 battalions of U.S. forces were stationed in the city of Baghdad in September 2007. As of June 2009, there were just 8 battalions stationed within the city.
This map from The New York Times looks at the changing demographics of U.S. forces in Baghdad and Iraq.
"Battalions that were living in outposts among the population move to bases at the outskirts of neighborhoods. In Baghdad and other cities, American troops are switching to an advisory role, supporting Iraqi units as requested, following the process started in Anbar Province."