In the History pane for a repository, right click on the commit of interest and select "Checkout commit" from the shortcut menu.
For more detailed information, see this URL:
https://docs.github.com/en/desktop/managing-commits/checking-out-a-commit-in-github-desktop