It won't retrace the path unless you have flown in a single straight line.
When you issue an RTH the drone locates the last recorded home point and then heads straight for that.
If it's not in Sport mode, and obstacle avoidance hasn't been switched off, then (theoretically) it will avoid the...