How to use bitbucket api to reset commit?

here is create tag api

curl --request POST
–url ‘http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags’
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–data ‘{
“name”: “tag1”
}’

I need change commit api in branch ‘stg’
which git command is

git checkout stg
git reset {commit} --hard
git push -f

can bitbucket do that? thanks

For sure, but rather not through REST API but simply using GIT :slight_smile: .

You can programmaticaly fetch desired repo, do changes and push them. Use any library for git you find for your platform of choice (java, node, etc).