How to delete latest Git commit in Bitbucket?

Viewed 16790

I am storing laravel files in bitbucket and I also have a local copy of the project. Every time i save my local copy, i push it to the remote repository in bitbucket so that they have the same update.

Problem: I made a mistake in my local project and I want to delete the latest commit in Remote Repository in bitbucket.

Does anyone know how to remove/delete the latest commit in bitbucket?

Thanks

5 Answers

Git deletes the last commit from Bitbucket.

  1. $ git reset --hard HEAD~1

  2. $ git push -f

  • reset hard hard 1:  for delete
  • push -f:  for fix the commit server.
Related