The 22-year-old has enjoyed several successful loan spells away from the club across the football pyramid and had an impressive 2021/22 season with Cardiff and then Blackburn.
It is understood that Bruno Lage is a big fan of the wing-back, who has also played as a winger, and it was thought that the head coach was keen to take a look at Giles in pre-season before potentially giving him a chance in the Wolves team.
However, just four days before the squad is due to return for pre-season, Giles has now returned to the Championship on-loan with Boro.
“We’re delighted to bring Ryan in,” said Boro boss Chris Wilder.
“There was a lot of interest in him and it’s great we’ve been able to bring him here.
“He’s a player we know a lot about, he's young and he's an exciting talent.
"He has plenty of experience already at this level and knows the league. I think we're good fit for Ryan and we're really looking forward to working with him."