Either demolish the wall.
How to fix a leaning concrete wall.
If the wall has moved significantly the soil outside the wall will have to be excavated and the foundation wall straightened or in the worst cases replaced altogether.
This mortar is typically one of the first things to show wear on a well made wall.
Something in between could be addressing the drainage behind which could help prevent further leaning.
Straightening the wall will require some engineering and is beyond strangers on the internet.
To fix the mortar carefully chisel out mortar to a point of a little over 1 2 the depth of the brick.
The repair methods for a leaning foundation wall depend on the amount that the wall has moved inward.
Install the wall plate and tighten the anchor rod.
Make sure that the rod connects to the anchors that are installed within the soil.
Using anchors drill a one inch hole unless otherwise specified by the wall anchor manufacturer in your retaining wall.
Wall anchors can be a long lasting solution to strengthen retaining walls and actually pull them back as close to their original position as possible.
Screw an anchor rod through the hole.
If the movement is minimal carbon fiber straps or steel wall braces are an appropriate repair to prevent further movement and the possibility of having to excavate and straighten the wall later.
Solution 2 wall anchors concrete retaining walls can be reinforced with wall anchors from matthews wall anchor waterproofing services.
So a totally proper repair would be to remove the whole thing and start over.