I know that this question is old, but all the answers provided thus far only dealt with the continuous variable cases. In the edit, @user54609 states that he/she was asking how to get the probability distribution of a discrete random variable, and for that case, the answer is surprisingly simple.
The only difference is that it is easier to do what you want using the characteristic function $G(s)$, instead of the moment generating function $E[e^{tx}]$. It is easy to convert between them by looking at the definition of $G(s)$:
$$
G(s) = \sum_{n=0}^{+\infty}p(n)s^{n}
$$
where $n$ is the discrete random variable, and $p(n)$ is its probability distribution.Thus, you can convert between $G$ and the m.g.f. by setting $s=e^{t}$.
Now, lets suppose that we know $G(s)$ but not $p(n)$, and we want to find out the functional form of $p(n)$ using what we know about $G(s)$. The way to do that is by evaluating derivatives of $G(s)$ at $s=0$ as:
$$
p(n)=\frac{1}{n!}\left.\frac{d^{n} G(s)}{d s^{n}}\right|_{s=0}
$$
For example, the characteristic function of a Poisson distributed random variable is $G(s)=e^{\lambda(s-1)}$. We can recover the probability distribution of the Poisson random variable $n$ as
$$
\frac{1}{n!}\left.\frac{d^{n} G(s)}{d s^{n}}\right|_{s=0}=\left.\frac{\lambda^{n}}{n!}e^{(s-1)\lambda}\right|_{s=0} = \frac{\lambda^{n}}{n!}e^{-\lambda} = p(n)
$$
You can ty this with other example distributions, such as the Binomial, whose characteristic function is $G(s)=\left[1+(s-1)p\right]^{N}$ to gain some trust in the method, but it works for all discrete random variables.