Reputation: 21
I just started learning java through a course and faced some problem. I had my first homework and I needed to push it on GitLab, where we have 2 branches - master (place to commit and push) and prod branch (where all materials for our education are placed).
I made a mistake and committed to prod branch and now mirroring is broken, so I can't get any new information from education project (lections, homeworks, etc).
I asked a teacher to help, but he says that I should revert my prod branch to started position. I told him multiple times that I don't know how to do that and asked him to connect view teamviewer (it will take 5 minutes of his time), but he is strictly pronetic, that I should do it alone, but I'm doing it 4 hours and there are no changes.
Upvotes: 1
Views: 11817
Reputation: 17408
You can revert a commit from GitLab UI commit details page:
See here for the official docs of Reverting a commit.
Upvotes: 1
Reputation: 68
I think what you are looking for is git revert <the SHA-1 of your commit>
. For finding the SHA-1 of your commit you can either use git log
or find it in GitLab interface. Once you have revert your commits localy just push back your branch and all should be good.
Upvotes: 1