Make previous commit as head

I committed a branch and it is merged with master. Later on production, it is found to be bug in the commit.

I need to raise a PR with previous commit of master against master.

I tried the following

git checkout <specific-commit-id>

git checkout -b <new-branch-name>

git push origin <new-branch-name>

When I try to raise PR against master, it says

The source branch is 2 commits behind the target branch

Expected it to allow me to merge it in master but it didn’t allow

How can I do so?

Follow the steps below,

git checkout <branch-name>

git checkout -b <new-branch-name> <properly-working-commit-id-of-current-branch-which-we-want-to-deploy>

git add .

git commit --amend -m 'commit-name'

git push origin <branch-name>

By doing so it allows us to merge in GitLab