I want to be able to restore the main branch to a commit, as how is was 3 merges before. Also, although its not really important, I would like to keep all the changes that were done after that commit (the 3 merges) and store them in another branch (or branches). So basically just restoring the main branch as to how it was in the past whilst also keeping the changes that were made after. And if this can be done using the GitHub web ui that would be great.
The comment from user "nullptr" above is correct.
I would add a couple of details to help avoid some confusion.
git checkout main
git checkout -b save-old-main
You can now use the "branch" command to reset main. It is important that you do not have main as your current branch when you do this, because it is not allowed to do this to the branch you have checked out.
git branch -f main hash-you-want-main-at