Help! After the end of the walking animation character is dragged back. How to fix it?

Yeah root motion didn’t work for me either. He kinda turn my character to the right in some sort of curve…