Reversible process means that given the outside controllable mechanical, electrical, magnetic, chemical, etc., macroscopic parameters $\hat x_1,\hat x_1,\hat x_2,...,\hat x_n$ of the surroundings and its temperature $\hat T$ at which heat exchange can also take place any and all internal thermodynamic properties (parameters), say $z$, of the system at any time instant during the process can be written as a function of said external parameters: $z(t) = f(\hat T(t), \hat x_1(t),\hat x_2(t),...,\hat x_n(t))$. Notice the function depends only on the instantaneous values and not on the time rates of the external parameters. The $t$ in the function is just a process index by which the various consecutive stages of the thermodynamic process is marked, i.e., time.
If the function $f$ is differentiable then a linearized approximation over a short time interval $\delta t$ will give $\delta z= \frac {\partial f}{\partial T}\delta \hat T + \sum_k \frac {\partial f}{\partial \hat x_k}\delta \hat x_k$. If all $\delta \hat T$ and $\delta \hat x_k$ are small enough steps, then flipping their signs will get you back where you started from. This is the change of direction in the process you are asking about.