Questions tagged [git-revert]

Revert changes of a commit in a Git repository

git revert allows you to revert some existing commits within a Git repository.

Popular questions

See also

References

$ git revert --help
493 questions
0
votes
1 answer

eclipse git revert/reset option not found

How can revert/reset a file using the eclipse egit (team) plugin? I'm opening the team menu but can't find any reset/revert option. See screenshot:
AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
0
votes
3 answers

How to find out branch numbers when reverting a merge?

History of my commits looks like: A - B - C - D - E \ / X - Y Branch ABCDE is master, branch XY is some other branch (say test), and D is a merge commit. HEAD now is at E. I need to return my working directory to the state of A on…
user3026384
  • 15
  • 1
  • 3
0
votes
1 answer

continue work and commits on same branch after having reverted/ reset

Man, this git thing surely is a hard nut to crack! So I have this branch: a--b--c--d - mybranch What I would do here is go back to commit 'b' and continue working and committing. but I would want to neither branch anew nor loose 'c' and 'd'…
kellogs
  • 2,837
  • 3
  • 38
  • 51
0
votes
1 answer

Reverting in Git to a specific point

I have a branch called: myBranch It has a bunch of changes on it on checking into the server. The revision I want to go back to is: 5b31ec198 What are the steps to get that from the server back to my local?
cdub
  • 24,555
  • 57
  • 174
  • 303
0
votes
1 answer

how to merge branches after Git revert

the story so far - project repository has among others two branches - update and master. There was a a try to merge update into master. But almost immediately master was reverted to it's original form (before merge) by the use of revert git revert…
Elmor
  • 4,775
  • 6
  • 38
  • 70
0
votes
2 answers

Moving master branch to original state before any commits

I apologise if this question has already been asked and answered, but I could'nt find it. Basically, instead of creating a branch, I have implemented a alpha version of an application in the master branch and committed a few times over the top of a…
PI.
  • 1,658
  • 4
  • 19
  • 33
0
votes
2 answers

Git revert screwup - recovery?

So I had two branches on github - master & refactor. I checked out refactor locally, and went to town. At some point, I screwed up and did a git push origin master instead of pushing to origin refactor, and furthermore, didn't notice the issue…
Irongaze.com
  • 1,639
  • 16
  • 22
0
votes
1 answer

git Repository: Is Previous File Version Accessible Outside of Xcode

With a git repository setup for my iPhone app, is there a way to gain access to the last committed version of a file outside of XCode? Can I find the previous version somewhere on the hard drive, or perhaps piece the file together somehow? The…
Michael
  • 648
  • 11
  • 23
0
votes
1 answer

What is the behavior of git checkout with one file?

If x and y were your files and you did a few commits like so: commit 0: x / y commit 1: x / y+1 commit 2: x+1/y+1 commit 3: x+1 / y+2 (HEAD) If you did: git checkout master~1 x Would you get x or x+1?
janson0
  • 137
  • 9
0
votes
1 answer

What's the simplest way to amend a commit in order to revert the modifications made to a single file?

Currently, when I have to do it, here are the steps that I follow: Revert the commit (without creating a new commit, of course) Reset all the modification introduced by the “revert,” except the one of the file that I wand to revert Stage the…
Samuel Rossille
  • 18,940
  • 18
  • 62
  • 90
-1
votes
1 answer

Is there an alternative to revert that will create a new commit ID?

I gave up trying to use git revert in my computer. Whenever I try to use it, I get an error Unlink of file Failed (Unlink of file' failed. Should I try again? (y/n)), and I tried implementing different solutions given on this website without much…
tadm123
  • 8,294
  • 7
  • 28
  • 44
-1
votes
1 answer

Undo git pull --rebase

Sorry for bothering everyone! Please help. I wrongly used the git rebase --hard and overwrite all local files. Then I use git reflog and git reset --hard but did not find the former version! I searched for many questions but it seems that they only…
stander Qiu
  • 122
  • 10
-1
votes
1 answer

Is there any way to merge the changes back to the branch when we perform revert in Azure DevOps

We have two branches called main and dev. Developers worked on the dev branch and they committed and pushed few changes to the dev. We are following PR process (Pull request) to merge the changes to the main branch. (we are using Azure Repos) Pull…
-1
votes
3 answers

Revert Pull Request in Github

I merged a pull request accidentally in github but it needs some changes how can I revert the pull request in github to add those changes that I want. Thank you.
-1
votes
2 answers

Why does git revert behave differently in these cases?

Let's say I have ProjectA and ProjectB in which I have only one file called test.txt in both projects and tracking it with git. After the first commit, the content of the file in both projects look like below. one two three four After second…
Zip
  • 5,372
  • 9
  • 28
  • 39
1 2 3
32
33