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

GitHub commits got deleted

I was working on my local copy of a GitHub project. After changing a few files, I tried to commit and I got the message This is not a github repository, so I did git init, git add . and committed (After adding the remote origin), and did git push…
The Wizard
  • 943
  • 7
  • 21
0
votes
2 answers

How can I reset to a commit and make it master?

I would like to reset m repository to an old commit and start tracking the changes from there. It is like 50 commits ago, so git revert is not an option. What should I do? P.S. update - I also need to push that commit and become the last commit in…
naneri
  • 3,771
  • 2
  • 29
  • 53
0
votes
1 answer

Stupid GIT GUI questions

I feel really stupid right now. I have used a number of version control apps but not git that much. I have read lots of posts, but am more confused than ever as many of the (apparently correct) answers use the command prompt and assumptions that I…
JustMeToo
  • 325
  • 1
  • 14
0
votes
2 answers

how to revert back my github repo?

I have forked my repo from some other repo and commited some changes.Now I want to update my repo with respect to the original repo and delete the commits I have made.I am first trying to revert it to the point where I have forked the repo then I…
user3870509
  • 307
  • 1
  • 3
  • 7
0
votes
0 answers

Deleted a remote branch that I have never had local

I am using the trash git client on my desktop for cleaning up in the dead branches. I accidentally deleted a branch that is published that one of my group members is working on. The git client gave me no warning just deleted the branch with a single…
0
votes
2 answers

How do I do a git replace rather than a merge

I am trying to do this the easy way and do less coding. I have the following commits in git A->B->C->D I want to basically remove commit C and keep commit D - and I am struggling to find a way how I tried git checkout -b myfix B git cherry-pick…
Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77
0
votes
1 answer

Git merge is saying I am already up to date

I am fairly new to git and haven't ever had to deal with much more than resolving some simple conflicts up to this point. I have a project and a team member and I were working on it. I pushed a bunch of my changes(394344b) while he was working on an…
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
0
votes
1 answer

How to revert an automatic subproject commit in git

I have couple of submodules in my project and I inadvertently made some changes to the modules. Though I did not explicitly check in the changes, I see the subproject commits when I diff the repository. (Using stash) When I do a git status on my…
quirkystack
  • 1,387
  • 2
  • 17
  • 42
0
votes
1 answer

How to undo a push in git?

I have a git repository and the scenario is like this. Past: rev 102 I made changes and pushed it to the repository, so Present: rev 103 Now, i want to undo all the changes and go back to rev 102 so that when users checkout/update the repository, it…
0
votes
1 answer

Why GitHub doesn't display the file history when the commit history does?

I've recently found a strange behaviour about GitHub repository. When I choose file and then its history (because I want to see all changes/commits to this file) there is only one - last commit: beans/AuthenticationBean.java. But when I check all…
Xenon
  • 189
  • 1
  • 1
  • 14
0
votes
1 answer

How to revert a few commits in Git without creating reverse patches?

Consider the following situation. There is a project X with some active upstream development. We are working on a fork of project X for our own internal purposes. Since we do not have write access to the Git repo of project X, we created our own…
Malte Skoruppa
  • 1,232
  • 1
  • 19
  • 25
0
votes
1 answer

Git `revert` in master deleting branch files if merged or rebased

I did something really stupid using revert and I don't know how to fix it properly. I'll try to explain clearly. I wanted to add foo, bar and baz in a project repository. For some reasons (because I'm an idiot), I did the following mess (where…
Lionel Gaillard
  • 3,023
  • 1
  • 21
  • 20
0
votes
1 answer

How to revert part of a commit?

There is a commit, pushed etc in the history of our repo. I have the SHA, and I would like to run the equivalent of git revert /one/folder/* THESHAID, but git revert doesn't look like it has the ability to change only a specific folder. Is there a…
Damon
  • 10,493
  • 16
  • 86
  • 144
0
votes
0 answers

Dangling commit is not in reflog and won't purge by git gc

I got a dangling commit that is not in the reflog (or I use it wrong) and won't go away with git gc. Here is what I mean: % git fsck Checking object directories: 100% (256/256), done. Checking objects: 100% (5425/5425), done. dangling commit…
LeMike
  • 3,195
  • 5
  • 25
  • 35
0
votes
2 answers

Back out a commit to origin/master

I'm relatively new to git, and I think I broke my master. Hopefully, someone can help me untangle it. I have my master on GitHub, and local master and tracking branch on my dev system. I also have the master on my QA system. On my dev system, I…
Bryan Watson
  • 80
  • 1
  • 2
  • 9