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
-1
votes
1 answer

how to get master version to develop in remote repository

I have a remote repository with some commits and pushs, but I need to undo all and bring master to develop repo. $ git log --oneline 4000708 (HEAD -> develop, origin/master, origin/HEAD, master) Initial Commit
IanPoli
  • 99
  • 8
-1
votes
1 answer

Can I revert to a previous version of just one file even if I git added all files before a commit?

Can I revert to a previous version of just one file even if I git added all files before a commit? So, this is what I did: git add . then git commit -m "my changes" then git push So there have been many other git add . and commits between "my…
YulePale
  • 6,688
  • 16
  • 46
  • 95
-1
votes
1 answer

why cant I push reverted commit in github?

I'm pretty new in git.I was working on a project and I used new commit that ruined my project. so I used git log and git check out to go back to last commit.that was successful on my computer but when I try to push it on github repository I see this…
bami
  • 211
  • 1
  • 6
  • 19
-1
votes
4 answers

Revert Local GitHub Repo All The Way Back

I know you can go in order of reverting commits but is there a way to completely revert a repo to when it was first initialized? This sounds extreme but I messed up with my commits because I was trying to use an existing React project to replace an…
LaLaLottie
  • 393
  • 1
  • 4
  • 17
-1
votes
1 answer

When reverting to git previous commit how to cherry pick?

I have reverted the previous commit, with below command: git reset HEAD~1 then, git stash to revert my last commit. What I want to know, Is there any way to revert one by one, rather than using the stash ?
Venkata
  • 1
  • 4
-1
votes
2 answers

After git revert, working tree remains the same

I have one bad pushed commit. How to undo this commit, and back to my working tree (was before)? This will lead me to right working tree: git checkout HEAD~1 This will lead me to right commit, but working tree remains the same unnecessary…
kAldown
  • 610
  • 2
  • 8
  • 27
-2
votes
2 answers

Reverting part of an earlier commit

I know I'm missing something obvious but... let's say I have 3 commits affecting the same two files: a and b. I want to revert the changes made in the 2nd commit to a, but I don't want to lose the changes made in the third commit to b. If I revert…
Jesse Liberty
  • 1,314
  • 1
  • 11
  • 26
-2
votes
2 answers

Git revert, how to undo my push merge to master?

I modified one file and did the following: cd puppet-configuration-prod/ git status git pull origin master git add Puppetfile_puppet-prod git commit -m 'modificaton Omar' git pull origin master git push origin master But this pushed a lot of…
Omar BISTAMI
  • 770
  • 2
  • 11
  • 19
-2
votes
1 answer

How to do Reverting in GIT?

I am learning GIt. I have 2 branches Prepod and Master. Working branch is prepod . I have commited the code on friday from prepod to master and i think there is some problem in the code. so i have to put the code of Thursday of prepod to…
GameBuilder
  • 1,169
  • 4
  • 31
  • 62
-2
votes
1 answer

github - commit not having my changes not merged

I have committed my changes and pushed them to the remote git repository. But when I have pulled others changes to my master branch, It merged my repo and I didn't have my old chnages. There is something wrong with the pull request I have merged.…
Mehul Kaklotar
  • 365
  • 1
  • 19
-3
votes
2 answers

'git revert' Changes Nothing But Adds a New Commit

I'm working on a project and I wanted to revert back to an earlier commit. This is the git log commit a342294cbf25550f48452807d33a64f0c0248c34 (origin/master) Author: analysis230 Date: Thu Jun 2 13:51:52 2022 +0530 …
Vipul Rajan
  • 494
  • 1
  • 5
  • 16
-3
votes
2 answers

How to undo committed changes to specific files without rebasing?

I made about 20 or so commits on this branch. Somewhere amongst those commits, I accidentally committed multiple refactoring changes to files that shouldn't be in my pull request. I'd prefer not to rebase one by one for every single file that has…
ScottyBlades
  • 12,189
  • 5
  • 77
  • 85
-3
votes
1 answer

Reverting GIT directories to previous ones in RStudio

I am using Rstudio to build an R package with version control being handled by GIT. There was a mistake and several files were overwritten and I would like to be able to revert back to a previous version in the commit timeline. Can I use the SHA…
RustyStatistician
  • 989
  • 3
  • 14
  • 25
1 2 3
32
33