There is a strong argument to translate the Hebrew verb (“ŝob”, ESV: restores) here with he brings me back,
as in: bringing back from a dangerous place to a safe place. That also fits well with the image of a shepherd with his sheep. The sheep regularly trail off the straight path, get lost, and then get into trouble easily. The shepherd must watch them continuously. This surely also applies to people. They have the bad tendency to wander away from their Creator. The world is so tempting for the hearts of men. But oh, how easily they get lost there.
This image of lost sheep, and people who lose their way, can be found in, for example, Ezekiel 34:1–31 and Ezekiel 36:1–38. That is why Jesus also tells the parable of the lost sheep (Luke 15:1–10). Immediately, Jesus speaks about the shepherd who goes to search for that lost sheep. This is how he is, and this is how his heavenly Father is. To be pulled away from our foolish ways, and to come home again with the Lord, is such a blessing for us as people! Isaac Watts says is accurately in one of his songs:
He brings my wandering spirit back,
when I forsake his ways;
and leads me, for his mercy’s sake,
in paths of truth and grace.1
3 He restores my soul. He leads me in paths of righteousness for his name’s sake.