Hume will remain with the Lilywhites until December 15, with Hayes returning to Oakwell as a makeweight in the move.
Hayes made 89 appearances for the Tykes after turning down a contract extension at Scunthorpe in 2005.
He returned to Glanford Park in 2007, but again left this summer when opted to move to Preston.
That has not worked out on the pitch for him, and he was deemed surplus to requirements by manager Darren Ferguson.
"It is a funny old game and you can never presume anything really. It has come out of the blue but I have the chance now to come here and play football. I have the chance to start afresh." he said.