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

remove remote commits that are not HEAD

I have a tricky situation. I need to remove and re-commit some commits that I already pushed to github remote repo. But these commits are not HEAD anymore (people pushed theirs on top of it). I understand I can do revert commits, therefore…
Boyang
  • 2,520
  • 5
  • 31
  • 49
0
votes
1 answer

GIT reset commit shows ahead/behind changes

In our project, using master and develop branches, a commit has been made directly on master (only three files, and those changes are also on develop branch). Now I need to merge develop to master, but I cannot since the history for master is now…
Francesco
  • 9,947
  • 7
  • 67
  • 110
0
votes
1 answer

Revert seems to disappear without an intermediate revert

I did a revert to a commit (pushed to remote of course). Then I saw after 2 new commits that someone modified the code that my commit reverted without an intermediate revert of my revert. How is this done?
Jim
  • 18,826
  • 34
  • 135
  • 254
0
votes
2 answers

Reverting to previous commit on Git (with no human interaction)

I found some questions about how to revert with Git, but those questions always needs human interaction or to need to which revision are you going to revert. In this case there is no human interaction and you are not telling the machine to which…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
0
votes
0 answers

Basic; commit, change branch, merge, switch branch, continue

Suppose I have performed the following steps (in a git repository); make changes on a branch, commit these changes create new branch and move there, push these changes to the new branch and submit and merge request into the previous branch checkout…
0
votes
1 answer

How to correctly revert multiple merge to remote master

I have 5 branches master, branch-1, branch-2, branch-3 and branch-4. I made some changes to branch-3 and merged to master and again did it twice, now I want to go back to the stage before all the 3 merge, I can checkout to that commit and create…
Prafulla Kumar Sahu
  • 9,321
  • 11
  • 68
  • 105
0
votes
1 answer

Proper way to clean git history on master

I am on branch "master". I had such git history: 333 (#82) 444 (#83) Then I done some commits and reverts (222->111->010->789->456->123): 123 Revert "(#84)" 456 Revert "(#81)" 789 Revert “(#81)" 010 Revert "(#86)" 111 (#86) 222 (#84) 333 …
Jesus_Maria
  • 1,137
  • 5
  • 14
  • 24
0
votes
1 answer

Remove a few commits far back in history

We are working on a repository with a fellow programmer which he commits to a separate branch and I on the master. A few days ago he decided to merge master into his branch but after merging faced some environmental dependency issues and decided to…
2hamed
  • 8,719
  • 13
  • 69
  • 112
0
votes
1 answer

Git reset some changes in a file,in command line

I changed something in a file, and did not use add or commit. Some part of my changes is not necessary, how can I only reset this part. (I know how to revert the whole file, but the file has many changes and only a little change must be reset.…
weijia.wang
  • 2,088
  • 2
  • 18
  • 32
0
votes
0 answers

Is there a way to undo `git push --force origin master`?

I created a repository, added some commits, pushed to GitHub. Later, I created a new project, new local git repository and I wanted to commit new files from new repository to the old repository on GitHub. So I executed: git push --force origin…
Defozo
  • 2,946
  • 6
  • 32
  • 51
0
votes
1 answer

Delete select commits and merge or rebase and add important commits

So i was checking for other solutions but it's not exactly suited for me I'm also dealing with a branch merge git log commit 6d034e1b1f03241b2c660312660ce29acca23f60 Author: ME Date: Thu Jun 30 13:09:08 2016 +0100 text…
segaps
  • 47
  • 6
0
votes
1 answer

Delete last push in git server

I deploy the code in one of my server with according to this tutorial: How To Set Up Automatic Deployment with Git with a VPS But now i have problems with some commit pushed to deploy server, some times the code inside of the githooks, make that…
aasanchez
  • 179
  • 1
  • 16
0
votes
1 answer

Is the full path required to unstage a file in GIT if am currenlty under a sub-directory?

Repo: mergetest $pwd /gitvobs/mergetest/apple $git status On branch br1 Changed but not updated: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) **modified: inside** $git…
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
0
votes
1 answer

GIT - undo specific past merge but need the commits made after that merge to be intact

I was working simultaneously on a Feature branch and Master branch. Few days ago I merged my Feature into Master. A few commits have been made on top of that too. But later I realised that the feature is no more desired. So I need to remove the…
7vikram7
  • 2,764
  • 1
  • 25
  • 43
0
votes
0 answers

idea git nothing to revert and commit

os:mac 10.11.5 ide:idea 2016 in idea , i write some code , then i want to commit it . use command line git status show me On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: modified: …