The root operator on invariant subspaces of the Bergman space