The Astros released Diaz on Friday, Matt Kawahara of the Houston Chronicle reports.
The Astros selected Diaz's contract Monday.
Diaz signed a minor-league contract with the Astros on Saturday, Chandler Rome of The Athletic reports.
The Athletics released Diaz on Saturday.
The Athletics designated Diaz for assignment Tuesday.
Diaz drew a start at third base in Thursday's loss to the Royals, going 1-for-2 before being lifted for a pinch hitter in the seventh inning.
Diaz started at second base in Sunday's extra-inning loss to the Blue Jays on Sunday and went 1-for-4 with a run.
Diaz (calf) was reinstated from the 60-day injured list Tuesday.
Diaz (calf) appeared in back-to-back rehab games with Triple-A Las Vegas on Friday and Saturday before receiving Sunday off.
Diaz (calf) started at third base and played five innings in Triple-A Las Vegas' win over El Paso on Tuesday, going 1-for-3 with an RBI single.