# [R], <s>122</s> 121 bytes

<!-- language-all: lang-r -->

-1 byte thanks to Giuseppe

    x=el(strsplit(scan(,""),""));n=seq(x);y=x>"/";for(i in n)cat(rep(" ",diffinv(y[n[-1]-1]+y[n[-1]]-1)[i]),x[i],"\n",sep="")

[Try it online!][TIO-j7kcvg1q]

With extra whitespace:

    x = el(strsplit(scan(,""),""))
    n = seq(x)
    y = x>"/"
    for(i in n) {
      cat(rep(" ", diffinv(y[n[-1]-1]+y[n[-1]]-1)[i]), x[i], "\n", sep="")
    }

Explanation: This answer is based on the observation that the number of leading spaces changes each line by -1, plus the number of `/` in the previous and current lines. 

If we have N slashes, the variable `y` is a vector of length N, with 1 for each position with `\`, 0 otherwise. Therefore, to get the change in number of leading spaces per line, we calculate `y[1:(N-1)] + y[2:N] - 1`. The function `diffinv` converts these differences into a sequence, starting with 0. The rest is just a matter of assembling each line as the required number of trailing spaces, followed by the relevant slash and a newline.

[R]: https://www.r-project.org/
[TIO-j7kcvg1q]: https://tio.run/##LYxBCsMgEEX3PUWY1Qy1hK7FXiRmYRNDB@zEqhRzemug8N7nrX5qgZ/JpQPfvrz2NVOrxgfMJeUYuGBenKACoFPSYrL/YCV9mPqAEfS2J@SBZRBaXMHkI8IAauVtY/niMcl0u8@d6z9708QzqdpXgRVQ2UfT3xuM1p7Apf0A "R – Try It Online"