Hamels (4-5) won for the second time in three starts, giving up one run, striking out nine and walking none.
He threw 71 of 95 pitches for strikes.
Rollins' 12th homer, coming off reliever Shae Simmons (1-1), made it 2-0 in the seventh.
Atlanta, which had a three-game winning streak snapped, cut its deficit to 2-1 in the seventh inning on Chris Johnson's RBI double.
Jonathan Papelbon earned his 21st save in 23 chances, needing only five pitches to retire Andrelton Simmons on a groundout, Freddie Freeman on a lineout, and Justin Upton on a popup.
Grady Sizemore reached base four times, going 3 for 4 and scoring on Rollins' homer.
This material may not be published, broadcast, rewritten, or redistributed.