In Nielsens and Chuangs book, they present a way to implement a reversible version of any classical algorithm (section 3.2.5).
In short, they use Fredkin and other simple reversible gates to implement a circuit doing $(x, 0, 0, y) \rightarrow (x, f(x), g(x), y)$ by first copying $x$ to the second register and then using the Fredkin gate equivalent of the classical algorithm to take the second register (now $x$) and the ancilla bits in the third register to $f(x)$ and some garbage $g(x)$.
Then they use $CNOT$ gates to add $f(x)$ to the last register, resulting in $(x, f(x), g(x), y \oplus f(x))$.
I understand that it is now important to uncompute the $g(x)$ garbage bits so that they don't mess with quantum interference that may occur later on the fourth register (the result). So they take the registers back to $(x, 0, 0, y\oplus f(x))$ using the inverse of the Fredkin gate implementation.
Now I am wondering if the following would also work: Take $(x,0,y)$ to $(f(x), g(x), y)$ using the Fredkin equivalent of the classical algorithm. Then use $CNOT$ gates to go to $(f(x),g(x),y\oplus f(x))$ and then do the uncomputation step as before to get $(x, 0, y\oplus f(x))$.
This way we save a register. I assume I am either making some mistake on the way or the authors deemed their version easier to understand.