Yes, but technically, it wouldn't be the same function.
For example, f(x)= x^2is not "invertible" because it is neither "one to one" nor "onto". However, if we restrict the domain to the "non-negative real numbers" then its inverse is \sqrt{x}. If we restrict the domain to the "non-positive real numbers" then its inverse is -\sqrt{x}.
However, the domain of a function is as much a part of its definition as the "formula". That is, "f(x)= x^2, for x any real number", "g(x)=x^2, for x any non-negative real number", and h(x)= x^2, for x any non-negative real number" are three different functions. The first does not have an inverse, the last two do.