Yes, but technically, it wouldn't be the same function.
For example, [itex]f(x)= x^2[/itex]is 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 [itex]\sqrt{x}[/itex]. If we restrict the domain to the "non-positive real numbers" then its inverse is [itex]-\sqrt{x}[/itex].
However, the domain of a function is as much a part of its definition as the "formula". That is, "[itex]f(x)= x^2[/itex], for x any real number", "[itex]g(x)=x^2[/itex], for x any non-negative real number", and [itex]h(x)= x^2[/itex], for x any non-negative real number" are three different functions. The first does not have an inverse, the last two do.