If you want to restore the GUI in Windows Server 2012 (and you didn’t install in core mode) you can use the following command
Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -restore
If you did install core, you need to have the CD / ISO inserted or mounted and append the -Source switch to tell it where to get the files to perform the install of the GUI from. i.e. you enter:
Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -Source C:Source -restart