apt – Uninstall OpenCV 4.2.0 and its Libraries

I’m quite new to Ubuntu and I just installed opencv and some additional libraries using

sudo apt update
sudo apt install libopencv-dev python3-opencv sudo apt install libjpeg-dev libpng-dev libtiff-dev

I’m now trying to downgrade from opencv 4.2.0 to opencv

How can I do this?