Let $G$ be a non-abelian group of order $8$. It is easy to see, that G has center $Z(G)\cong\mathbb{Z}/2\mathbb{Z}$. Set $Z(G)=\{e,z\}$. Is is also easy to see that $G/Z(G)\cong V$ is the Klein four group. Hence set $$ G/Z(G)=\{Z(G), aZ(G), bZ(G), abZ(G)\}. $$ As $G/Z(G)$ is abelian, each of its element is the only element in its conjugacy class. I want to find the conjugacy classes of $G$. I suppose that they are $$ \{\{1\},\{z\}, \{a,az\},\{b,bz\},\{ab,abz\}\}. $$
How can I find in this specific example (assuming that I don't know from the classification the precise structure of the two possible groups $G$) the conjugacy classes of $G$, if I already know the conjugacy classes of $G/Z(G)$?
Can I perform this strategy for a general $G$, if I already know the conjugacy classes of some factor group $G/N$?
From an answer to this question, I already know that the preimage under $G\to G/Z(G)$ of a conjugacy class in $G/Z(G)$ is a union of conjugacy classes of $G$ but how do I know which of the preimages 'decompose' into conjugacy classes and which preimages don't?