Hamels was placed on the IL on June 29 with a left oblique strain suffered against the Cincinnati Reds the previous day.
The 35-year-old is 6-3 this season with a 2.98 ERA in 99 2/3 innings. He has 97 strikeouts and 35 walks over 17 starts.
Hamels made two minor league rehab starts at Triple-A Iowa in preparation for his return, pitching a combined 5 1/3 innings and allowing three earned runs on four hits and six walks with six strikeouts.
In a corresponding move, right-hander Brad Brach was designated for assignment. Brach, 33, was 4-3 with a 6.13 ERA in 42 relief appearances this year.