Questions tagged [git-revert]
Revert changes of a commit in a Git repository.
git-revert
512
questions
0
votes
1
answer
69
views
Revert and delete Azure DevOps commit history?
I made a small commit and pushed it to our main branch in Azure DevOps. I realized that this commit was obsolete, as it was based on wrong assumptions and miscommunication with my colleague, who made ...
1
vote
1
answer
60
views
Git Blob_id with no path, how to erase it [duplicate]
I am not an expert with GitLab, so I am seeking help.
I have a git repository and I made the mistake to install a code inside with files bigger than 100 Mo, and I committed several times before ...
0
votes
2
answers
63
views
How can we revert particular commit in local from bunch of commits?
Requirement: Revert particular commit in local by commit ID.
Description:
I have a branch cloned in my local from some repo.
I made some changes and committed time to time (Not pushed)
E.g.
Made ...
0
votes
0
answers
12
views
Issue with Github compare after a revert
This is the layout of my Git projects.
Master < Dev < Dev2
I have been working on changes on Dev2 for months, and recently moved them up to Dev to get ready for deployment. In the mean time a ...
1
vote
3
answers
112
views
Git revert for multiple merge and commits to a particular commit state
I understand that this question has been asked multiple times, but either the scenario was a little different or I couldn't really understand it.
Basically, my git history looks something like this:
...
-1
votes
2
answers
45
views
how to push an old reseted or reverted heads
I can go back and forward in my history using git checkout heads git revert heads git reset heads
And when I do git push origin main I get Everything up-to-date and no change on remote server.
how to ...
1
vote
1
answer
49
views
Remove very old commit that added a contributor to my repo
Almost 10 years ago I was playing with a bot (waffle.io to be precise) in my repo. It pushed a single commit adding a badge and I quickly stopped using the service and the badge.
It bothers me that ...
0
votes
0
answers
44
views
How do I revert git checkout from a feature branch? [duplicate]
I'm new to git.
I generally create a new feature branch from master & then work on the task.
Recently, I executed git checkout instead of git switch when moving from master to my existing feature ...
-1
votes
1
answer
43
views
How do I git revert to a point at which my fork is both behind and ahead of the upstream?
I was working on a fork of a github project and wanted to incorporate the changes on it into my fork, so i could open a pull request. However I made some mistakes during the merge and ended up ...
-1
votes
3
answers
50
views
How to remove a feature from master-dev after has been intermingled with other feature commits?
Let's say we have a git repo with a master-dev branch. When developers complete their features, each feature branch in merged into the master-dev. One day, A large feature is merged into master-dev ...
1
vote
1
answer
38
views
Revert merged PR from git master branch
I have 2 git branches master and develop. master is production ready and develop is live development branches. I opened a PR to merge develop changes into master which had changes and commits which ...
0
votes
0
answers
34
views
Revert Git rebase that is pushed to origin
I did some changes in my feature branch. Before pushing, I rebased it to master branch
ON BRANCH Feature(featureBranch) ->
git rebase master
then i pushed it
git push origin featureBranch
Then I ...
0
votes
0
answers
28
views
Does git revert only take previous commit-hash, and for others we need to use HEAD~3 syntax?
I
I am providing git revert 5thCommitHashFromHead, it says auto-merging, I removed conflicts from code editor, it still shows master|reverting, but when I provided git revert HEAD~5 it works fine, do ...
0
votes
1
answer
56
views
How to prevent git from applying recorded changes during a git revert
So I did a git revert and resolved the conflicts which turned out to not be the correct resolution. Now the next time I do a git revert, to get to a stage where conflicts are still unresolved, git ...
0
votes
0
answers
47
views
Cannot Merge GIT branch [duplicate]
I have on the branch dev and I created new branch from this branch
with git checkout -b dev3
and I do some modification on this dev3 branch. After commit I merge it again to dev branch so I go back to ...
0
votes
2
answers
223
views
Git revert to previous local version after a pull request
I am new to working with Git. I made changes to a website in a local folder. When I wanted to push them through, an error occurred:
[rejected] master -> master (non-fast-forward)
error: ...
0
votes
1
answer
35
views
Git easy way revert pushed merge
I pushed some changes to my branch (call it point A). I merged some changes from remote branch (call it point B). I pushed some new changes to my branch (call it point C). I realized than merge (B ...
0
votes
1
answer
110
views
Problem when using GIT REVERT (CONFLICT deleted in empty tree and modified in HEAD)
I am a git beginner and I ran into a problem with GIT REVERT.
Here is the steps that I took:
mkdir new-repo
cd new-repo
git init
echo "first line" >> test.txt
git add .
git commit -m &...
0
votes
0
answers
34
views
VS Code git revert change inline within submodules fails
I still have the same problem as described in following issue:
https://github.com/microsoft/vscode/issues/177453
However, looks it was fixed here:
https://github.com/microsoft/vscode/pull/177691
My VS ...
0
votes
1
answer
54
views
How to revert git branch with all commits?
I was deleted my barnch form Github Branch Page.
What i did before deleted my branch?
Resetup my ubuntu os, git SSH keys, downloaded repo zip file.
Extract the zip file.Then added remote url.
Then ...
0
votes
0
answers
22
views
revert tagged commits back to a different branch [duplicate]
Say I have two branches A and B, where B is 10 commits ahead of A.
Some of the 10 commits are tagged with special_tag.
I want to revert all the commits tagged with special_tag until branch A.
How can ...
1
vote
1
answer
273
views
My changes are deleted during merge with master after revert
I have merged a development branch into master. But it was discovered the merge introduced bugs to master, so I reverted my commit. I have fixed the bugs, but when I try to pull from master into my ...
0
votes
0
answers
38
views
Revert a pull request - Shared Branches amongst developers
I'm unfamiliar with git reverts,I've been asked to undo or remove an old pull request to a main branch since it will not be deployed. I added a diagram to illustrate, I hope someone can help revert ...
0
votes
0
answers
132
views
Remove file from existing commit in Sublime Merge
How to remove specific file from existing commit (the last commit in a branch) in Sublime Merge?
1
vote
0
answers
18
views
Discard a specific commit when merge until new modification on the file
Hello,
I have 2 branches on Github ("A" and "B" because I have 2 projects) and weekly, I merge "A" into "B" but not "B" into "A" (to keep &...
1
vote
1
answer
42
views
Revert changes in Git "main" to prior commit, after branching out with all changes since in "new-branch"
I erred by working locally on a local repo's "main" branch, instead of branching out with a new branch and modifying code there. I brought more modifications to the code than I thought I ...
1
vote
1
answer
1k
views
How to undo code that is pushed to main branch and merged
I want to undo my push to the main branch which is merged as well.
Note: I remember that pushing to the main branch isn't a good practice, but there were some commits showing in my main branch of the ...
0
votes
2
answers
134
views
Switching between reverted and un-reverted states of a commit to apply old/new settings to config files
I am wondering if it can be done the way I am imagining it could work.
I tried to find a solution to something that cannot be done within Obsidian or with URL schemes (neither with the Obsidian ...
-1
votes
1
answer
138
views
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 ...
0
votes
0
answers
486
views
Unlink of file' failed. Should I try again? (y/n)
I'm trying to revert the last commit that I did. I recently had added three submodules into my repository.
When I try to revert the last commit
git revert --no-commit 787d04a
I get:
Unlink of file '...
0
votes
0
answers
132
views
Reverting commit on bitbucket cloud GUI
Is there a way to revert a commit on the bitbucket cloud GUI? I want to revert the last commit on a branch.
0
votes
2
answers
60
views
Revert an earlier commit that has conflicts with no commit
Let's say I want to undo the last-but-one commit in my working tree only, and all my commits have already been pushed. Usually I use git revert -n <HASH> (see this answer). However, if that will ...
2
votes
1
answer
344
views
Revert all merged commits after pushing them to remote
I have the next case.
There are two branches:
dev- our development branch that includes all the current results;
ml_DEL-1049 - my working branch which was created for the particular task.
While I was ...
0
votes
2
answers
80
views
Did we bork our repository? -- merged wrong way, then reverted, now merging the other way does something weird
We have Dev, our long term release branch (not Master, don't ask why)
We also have FeatureBranch, an old branch with many commits/pushes
I mistakenly merged Dev to FeatureBranch rather than the other ...
0
votes
0
answers
32
views
Remove all the changes made by a particular branch (developer)
We 4 developers work on a single project and merge our code into development. Now I want to undo all the changes made to my particular developer branch. How can I do that? And I want the code of all ...
-1
votes
1
answer
411
views
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 ...
0
votes
1
answer
66
views
Git, bitbucket: Revert (Not Reset/Not Delete) Branch as initial Creation, IntelliJ
I would like to revert all changes made, as the branch was created!!!
Unfortunately, I can't delete the branch, or made a Reset.
Here a image on my IntelliJ.
Check the initial creation in terminal
...
0
votes
1
answer
58
views
Revert HEAD{2} from a branch without reverting HEAD{1} [duplicate]
I am trying to contribute to a GitHub repository. The commit from before I started contributing I'll call "a". I made a commit "b" and my pull request for it was accepted. I then ...
1
vote
3
answers
693
views
Git lab showing "There are no commits yet" after my git reset?
I have three branches in my GitLab
Main
ppp7
ppp7-master
ppp7---> ppp7-master---> main
every day I'm pushing my new code into ppp7 branch.if code is running fine in ppp7 branch, i create new ...
0
votes
1
answer
88
views
Reverting changes in Git and keeping later changesets
I'm unsure if I wrongly understood how the revert works or is it Visual Studio just doing something weird.
Firstly I made the following commit inside of master branch
WriteNumbers(100, 2);
void ...
0
votes
1
answer
30
views
Reverting a few of the commits to the repository, while saving the commits that are being reverted in a separate branch to be applied later
We are migrating our code to a higher version of the underlying framework (.NET 6). This has resulted in a few commits to the repository. It was recently decided that we are not yet ready for the ...
0
votes
0
answers
34
views
Deleting a file from an old commit, as if it has never been committed (so that it does not appear in subsequent commits)
I have a Git repository where I have added, committed and pushed some files a month ago, which, I was now informed, should not have been on the root level and not in the repository at all.
Note that ...
0
votes
1
answer
2k
views
How to resolve all merge conflicts in a git revert so that only the HEAD (current change) changes are committed to the branch
I recently created a branch off master to revert a very large commit.
I first created a branch off master then,
I used git revert "commit tag from gitlab",
but I have a lot of merge ...
1
vote
2
answers
46
views
Git revert back and append changes
In multiple script files, certain lines were replaced with new ones.
In git it looks like that:
- Write-Host "Something went wrong" -ForegroundColor Red
+ Custom-LoggingFunction "...
-1
votes
1
answer
998
views
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 ...
0
votes
1
answer
895
views
Does git revert works with tag?
I am working with code rollback on my branch, I need to check if git revert works with tags as well ?
Example: git revert <tagname>
Also, after git revert, do I need to also run git push on my ...
-1
votes
3
answers
2k
views
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.
0
votes
1
answer
70
views
Git Revert but don't lose files
Say I commit 5 files with changes. Then I realize that I want to revert so that I can get rid of the changes in 2 of them, but I want to keep the changes in the other 3. Is there a reasonable way to ...
0
votes
2
answers
671
views
Reset merge to feature branch
I have feature branch and develop branch and I created feature from develop
and made changes and created pull request but, now I have some other changes need to be merged from develop as there are ...
-1
votes
2
answers
94
views
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 ...