The uninstall should only removes packages and dependencies if you want it to.
Do you want to remove all the system packages that RetroPie depends on?
WARNING: this will remove packages like SDL even if they were installed before you installed RetroPie - it will also remove any package configurations - such as those in /etc/samba for Samba.
If unsure choose No (selected by default).
Did you choose yes to this?