You can go to /var/log/apt/
and read the history.log
as it will contain every single package that you did install/remove.
Based on that you can just restore it to working state by manually undoing the changes (removing installed, installing removed)
“There are only 10 types of people in the world: those who understand binary and those who don’t.”
https://www.exploringbinary.com/there-are-10-types-of-people/