E
E
Evgeny Ivanov2020-10-19 20:11:10
git
Evgeny Ivanov, 2020-10-19 20:11:10

How to rollback changes in GIT?

I'm new to git. I use GitHub Desktop, Sourcetree, SmartGit.

Created an "empty-gitignore-readme" repository on bitbucket. Cloned it to the computer (specified the folder).
Created a project in this folder.
In work I use one branch - the master. I change the project, make a commit and push everything to bitbucket. Everything is fine, no errors.

But now, after a couple of changes and commits, the project stopped working normally. You need to roll back the changes.
How can I roll back changes to the previous commit and overwrite all subsequent ones?
Those. to delete everything that was after the specified commit everywhere - locally and on bitbucket?

PS
At first, it seemed to work Reverse commit, then errors began to appear, requests to commit something else, requests to resolve the conflict. And all this is in the commits above. And I don’t need them, I just need to roll back to the point / commit earlier and erase everything above. everything is wrong there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2020-10-19
@logpol32

Of course, you can delete, but still git is not created for this, especially for the master branch.
The options I would suggest are:

  • Make a new commit that fixes bugs
  • Do a git revert on one or more commits

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question