How do I revert back from CUDA 12.5 to CUDA 12.1

I am trying to install pytorch on wsl2 in a conda environment with ubuntu 22.4.
Recently I updated the drivers and the CUDA version is now 12.5 but the latest stable version of pytorch requires CUDA 12.1.
So is there any way to revert back to 12.1 ??