The 20-year-old was the fourth signing inside a week by manager Mark Yates.
"Michael has been on our radar for a while," Yates told the club's official website. "We are delighted to have brought him here because we've been monitoring him for a while.
"We liked what we saw of him last season with Barnet and a good friend of mine, Ian Foster, recommended him as a decent defender from when he was at Dundalk. He is 6 foot 3/4, quick, mobile and strong."
Hector has previously spent loan spells with Dundalk, Barnet, Shrewsbury and Aldershot.
He becomes the third player to join the Robins from the Royals this season, following in the footsteps of Lawson D'Ath and Jake Taylor.