In the introductory text to quantum field theory by Peskin & Schroeder, they state that in analogy to the simple harmonic oscillator in quantum mechanics, the free scalar field can be expressed as:
$$\phi(\vec{x}) = \int \frac{d^3 p}{(2\pi)^3} \frac{1}{\sqrt{2 \omega_p}} \left( a_p e^{i \vec{p}\cdot\vec{x}} + a^{\dagger}_p e^{-i \vec{p}\cdot\vec{x}} \right) \tag{2.25}$$
In quantum mechanics $\phi$ would be written as:
$$\phi = \frac{1}{\sqrt{2 \omega_p}} \left( a + a^{\dagger} \right)$$
I can see the similarities between the two expressions, as well as the fact that one may expand the free Klein-Gordon field as:
$$\phi(\vec{x},t) = \int \frac{d^3 p}{(2\pi)^3} e^{i \vec{p}\cdot\vec{x}} \phi(\vec{p},t).\tag{2.20b} $$
However I don't get how to reach the final expression given above, especially the exponential with negative sign in the second term. It's probably just a small thing that I am not seeing, but I would be thankful if somebody could give me a hint.