Revert to previous git commit

Undo commits permanently

Find the commit you want to revert to on bitbucket

Checkout that commit

git checkout <commit hash>

make a new branch based on that commit

git checkout -b <repair branch>

add any other later commits you want to keep (optional)

git cherry-pick <commit hash>

Switch to the broken branch

git checkout <broken branch>

Perform a hard reset on the broken branch to the commit prior to the commit you want to revert to

git reset --hard <commit hash>

Merge your fixed branch back into the reset branch

git merge <repair branch>

Push the changes back to the origin (may need to force)

git push --force origin <broken branch>