D
D
Denis Bukreev2018-10-23 19:28:28
Bitbucket
Denis Bukreev, 2018-10-23 19:28:28

How to remove latest commit from bitbucket?

It's not a simple matter for me.
The project is ancient, confusing, made by crooked developers, that it was barely stuck on the server, and even then not the first time.
I tried to run it locally and run it this way and that - nothing helped. I decided to work with styles "blindly" - I make changes, pull on the server and look.
And so forgetting that I tried to install it, I made a few changes, pushed to the repository, pulled on the server and the project lay down.
Quickly rolled back to the previous commit on the server.
But how do I remove my last commit from the repository now? I tried git revert locally - the commit was deleted, but all the changes that would be committed anyway remained. Demolished the local clone altogether, cloned the repository again.
What is the right thing to do so that only the previous commit remains without any changes?
There would be a "delete last commit" button in the bitbucket interface - it would be ideal.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sttrox, 2018-10-23
@sttrox

Go to the last commit you want to save and enter the command
After that, all commits that are after the one you selected will be cut off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question