Linux uses a heterogeneous GUI stack, meaning it's arranged in layers but there's different layers you can arrange.
The bottom of the stack is relatively homogeneous, meaning it's almost always the same. This is the Xorg server joan has indicated.
However, while X all by itself does provide you with a graphical desktop, it doesn't look like much -- plain black screen with a cursor. This makes just launching applications difficult, since there are no menus or taskbars either. You can configure a terminal to launch at start up and go from there, but realistically, additional software is needed.
This is where the next two layers, the window manager (WM) and desktop environment (DE) come in. The latter requires the former but not vice versa. There are stand-alone WM's that have most of the features associated with a graphical desktop, but linux distros usually use a more minimal WM with a heftier DE on top.
The default DE on Raspbian was (keep reading)
lxde. If you want that back, I imagine
apt install lxde should do it. There may be more pieces needed in the end -- you can see a list of possibilities with
apt-cache search lxde. The other common linux DE's are also available, but most of them consume more resources which is why lxde was chosen as the default on the pi.
Note that this does not include a graphical login, which is the task of a display manager (DM). The default on raspbian is
lightdm, which you can install with
apt-get install lightdm.
To sum up the two parts you'd need to get the original GUI system back would be:
apt install lxde lxde-core lxterminal lxappearance
apt install lightdm
These should drag in X and other dependencies if they are not there already. If you wish to start X from the command line using
xinit, you'll need:
The new default DE is the Pi Foundation's tweaked branch of LXDE, PIXEL. Apparently you can install that with:
apt install raspberrypi-ui-mods
This may or may not include a display manager for GUI logins.