Wei Zhou's answer already gives a very good example and I agree with the above comments. **However** for a "way out" - I want to give you two classes of obtacles, if you additionally remove the first, you're on your way to a well-known equivalence, which is weaker than isomorphy but helps e.g. in $p$-groups.

**1) In my opinion the serious thing:** You loose knowledge of the commutator map $G/G'\times G/G'\rightarrow G'/G^{(2)}$ and only preserve THAT elements appear as commutators.

Take as **example** the **extraspecial groups** $p^{2n+1}_\pm$ (such as the direct product with centers identified $D_4\ast\ldots\ast D_4$) compared to e.g. these one: $p_\pm^{2\cdot 1+1}\times \mathbb{Z}_p^{2(n-1)}$ (such as $D_4\times \mathbb{Z}_2^{2(n-1)}$). Both are central/stem-extensions of $\mathbb{Z}_p^{2n}$ by $\mathbb{Z}_p$, but the second is a lot "more commutative" ;-)

**2) A lot more tricky to detect but maybe not-so-serious:** Even if the commutator maps match, it remains unclear how elements powered-up/"fused" to the divided-out commutators.

Best **examples** are certainly the different extraspecials $p_+^{2\cdot n+1}$ vs. $p_-^{2\cdot n+1}$, especially $D_4$ vs. $Q_8$ (as Zhou said), that can only be distinguished by how many elements powering to the central commutator.

The latter behaviour is sometimes described as the groups being **isoclinic** (there are different definitions!) and this is also responsible e.g. for the three different nonabelian isomorphy types in order $2^n$. It is fairily mild and used e.g. in the classification efforts on $p$-groups. Most prominent examples you get from **different Schur covers** of a group being isoclinic (again $D_4/Q_8$ but also the different 2-covers of $S_n$). In this situation by construction all isoclinics are **isomorphic as grouprings** $k[D_4]\cong k[Q_8]$ and hence have the **same representation theory**, although I have no sources confirming this for nonabelian extensions!!

**Hope that helps ;-)**