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

Revert back Push which is not merged yet

I'm working on Git-hub tool, there mistaken I push some file with local branch code which I don't want to merge in master branch. How to revert back "Push file" back to local system Or if there way to remove not require files from Github itself. Any…
CoDe
  • 11,056
  • 14
  • 90
  • 197
0
votes
1 answer

git checkout commit and then making it the base

I'm on a branch called A.. the branch A has two commits, with the following codes: commit1 and commit2 where the most recent is commit2. i just noticed i want to go back to commit1 because in commit2 I deleted a file I needed and i wrote some…
valerio0999
  • 11,458
  • 7
  • 28
  • 56
0
votes
1 answer

Reverting commited changes for local changes

I have made a bunch of changes to a repo. When the changes were completed I completed a stage, staging all those changes. Then committed them locally. Once complete I attempted a push, but the repo had changed. I then completed a rebase (instead…
StuartM
  • 6,743
  • 18
  • 84
  • 160
0
votes
1 answer

Simply reverting changes from a commit

Say I have a file that has been added to over time and committed into Git each time. How does one simply revert one of the earlier commits but retain the all the following commits? For example, a blank file.txt is added and committed. Each…
skube
  • 5,867
  • 9
  • 53
  • 77
0
votes
1 answer

Fixed double accidental merge and push in git

I royally messed up the git repository of one of my projects and need help fixing it. This is what I wanted: alpha E-- / master --A-- |\ beta | B--C-- \ gamma D-- Four branches total, 3 unstable branches…
LambdaBeta
  • 1,479
  • 1
  • 13
  • 25
0
votes
1 answer

Eclipse Git | Reverting merge commit

Using Eclipse Git (the one bundled by default on Eclipse Mars.1 - JavaEE version), is it still possible to remove/delete a wrong merge commit? Since I'm still new to the UI of Eclipse Git coming from a terminal user, I accidentally merge the wrong…
David B
  • 3,269
  • 12
  • 48
  • 80
0
votes
1 answer

Undo multiple git merges

I have two git branches (master and fix_log_messages). I have been making various commits in the fix_log_messages branch and then periodically merging these changes/commits into master. As a result, the master branch contains multiple merges, due to…
Benjen
  • 2,835
  • 5
  • 28
  • 42
0
votes
0 answers

Git revert pull doesn't work

I did a mistake this morning and pull my master on my branch. I try reset to HEAD@{13} but doesn't work, my work is still missing :s Thanks for your futur help,
0
votes
2 answers

Retrieving original commit hash from a revert commit

Suppose I have this history: ... * c1 ... * cr: git revert c1 ... Given the commit hash of cr, is there a programmatic way to retrieve the commit hash of c1? It doesn't need to be porcelain, plumbing is fine too.
Cactus
  • 27,075
  • 9
  • 69
  • 149
0
votes
1 answer

Reverting renames to make git log work again

I did not realize that git does not understand file renames (by design(!)) and moved some files around. Then I put them back. Now git log seems to work, but git log --follow does not. And Eclipse seems to use the latter. (git log --follow could…
Tuntable
  • 3,276
  • 1
  • 21
  • 26
0
votes
2 answers

Git divide commits between branches

Currently i have my remote develop branch with commits like: C1 -> C2 -> C3 -> C4 -> C5 -> C6 (Cx as commit x) I need to divide these commits to new branches, so it will look like this: Develop branch: C1 C2 C6 NewBranchTwo: C3 C5 NewBranchThree:…
0
votes
1 answer

git revert HEAD when I have a local commit

What happens if I execute the following command when I have a local commit (i.e. a commit that I haven't pushed to the remote repository yet) that I want to revert back ? git revert HEAD I researched a lot and found out that - "git revert $id" is…
0
votes
1 answer

Remove a commit revert in git

In git (I am using tortoiseGit) I have a single branch and I made a commit. This commit is a security patch that modified something like 10 files. When I pushed this commit to my dev site it broke the site. I reverted the commit and worked on other…
user2642759
  • 33
  • 1
  • 6
0
votes
1 answer

How to revert specific files/folders

Let's say I have a git repo and inside there are various sub projects. How can one revert back changes in one sub project without affecting all the other sub projects to the state they were in of the commit you want to revert to? So for one sub…
alexfvolk
  • 1,810
  • 4
  • 20
  • 40
0
votes
2 answers

GIT: remove commit halfway down in log but keep all overs

Hi I have a commit in my git repo which I want to remove, but I want to keep all other commit thereafter. df5bf4b != 'Test' to =='Test' c1f6f9f fixed occupations getJob to check if is empty 4e818fa added utility links partial to client template.…
user0129e021939232
  • 6,205
  • 24
  • 87
  • 140