git-revert

Why is git revert telling me “bad revision” when I use a commit hash?

倖福魔咒の 提交于 2019-12-05 11:06:08
I am trying to revert to an earlier git commit but get the error "bad revision". Why? Here is a transcript (with author names removed): Ellen@ELLEN-PC /c/Users/Susan Mills/git/hello-github (master) $ git status # On branch master nothing to commit, working directory clean Ellen@ELLEN-PC /c/Users/Susan Mills/git/hello-github (master) $ git log | head commit e3eb30cc7ca6d4cd10de755b63821cad75da1e83 Date: Wed Feb 5 17:54:32 2014 -0800 I changed my greeting. commit 063ac580e28bab524286dac7b0a8f88d9e7d365f Date: Mon Feb 3 07:53:19 2014 -0800 Ellen@ELLEN-PC /c/Users/Susan Mills/git/hello-github

Git Revert Error Message?

北慕城南 提交于 2019-12-05 08:59:33
While trying to revert a commit I made to my repository of my .emacs.d folder I get the following message: haziz@haziz> git revert 7fe3f error: could not revert 7fe3f0b... .emacs.d contents from ubuntu hp 15 hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit' What I am trying to do is reverse changes I made to my init.el file and have followed with another commit which I am trying to reverse. I would prefer to revert rather than reset --hard since as far as I know the latter completely

How to cherry pick commits after they've been reverted?

笑着哭i 提交于 2019-12-05 06:52:37
I was working on my feature branch and after review, merged it into development to be deployed. Later, a coworker decided to do a release and merged his and mine into master . While deploying he realized his code was buggy and reverted master . In our fork-and-pull flow, that means that now development and master are both reverted. When I came in this morning, I rebased from development per usual, to learn afterward there had been a revert. Now I'm trying to cherry-pick my work from the original feature branch only to realize it gives me "empty commit messages" because of the revert. is this

How to revert a merge which used strategy=ours?

陌路散爱 提交于 2019-12-05 02:50:11
I'm working with a repository where a merge was performed weeks ago which we just discovered used the --strategy=ours flag (it was supposed to use the --strategy-option=ours flag), thus not applying any changes to HEAD. However, we need to have the changes applied. Git already recognizes the branch as being merged and the commits in the history of the branch. This sort of merge can't be reverted using git revert -m ... What would be the proper way of reverting and/or re-applying the merge to change the files? master A - B - E - F - G ---> L - M - N \ / topic C - D Merge commit (F) would be the

Remerge after reverting failed merge

心已入冬 提交于 2019-12-05 02:09:19
问题 I have two branches in repository: feature and master . I have merged master into feature and pushed result to remote feature branch: git merge master because it contains necessary changes of external interfaces. Than I have discovered that merge conflicts were resolved wrong and I have reverted this merge with: git revert -n -m 1 78e7ebfa8237 So I'm back on feature not merged. But according to history merge already happened and feature branch already contains necessary changes. Can I try

Git: How to reset after merging?

时光怂恿深爱的人放手 提交于 2019-12-04 13:19:41
问题 I've merged a master branch from a friend's repository into my working directory into branch_a using: git pull my_friend master I've discovered that the merged version has errors. To continue development I would like to revert to my last commit before the merge. I tried: git reset --hard HEAD But that brought me back to the state right after the merge. (does pull command commit?!) I also tried: git revert HEAD but received the following error: fatal: Commit

Restore deleted file not staged in git

萝らか妹 提交于 2019-12-04 00:23:18
问题 I accidentally removed the entire directory of my source code...with a nice rm -r. I know, really bad; but fortunately, I had a git repo in the containing directory. Thus, git has a huge list of unstaged changes of deleted files. For example: "deleted: src/caronmonitor/server.py" How do I get these files back? There is advice all over the web to do: git checkout file or git revert <commit> But as I understand that will restore the file to it's state at the last commit. I don't want to go back

git revert <hash> not allowed due to a merge but no -m option was given

故事扮演 提交于 2019-12-03 14:52:59
问题 I am trying to revert to a certain 'hash' number in git, by using the 'revert' command. I am using the following command: git revert c14609d74eec3ccebafc73fa875ec58445471765 But, I am getting the following returned: error: Commit c14609d74eec3ccebafc73fa875ec58445471765 is a merge but no -m option was given. fatal: revert failed As a new git user, please can you explain what is happening & what I have to do to resolve this. I want to revert back to this certain commit (

Git Revert a Revert for a Merge

你说的曾经没有我的故事 提交于 2019-12-03 12:48:21
I had a feature branch created, let's say feature/branch1 on github. I created a pull request for it and got it merged. When it reached our pipeline, we figured there was a problem and we got it reverted using the Revert button on Git This created a "Revert" PR that we merged with the master and all was well. After a few weeks, post other PRs that got merged into the master, we figured we would revert-the-revert . This time, we went into the Revert PR that was closed and tried to use the Revert button again. But we got this error message Sorry, this pull request couldn't be reverted

Git: How to reset after merging?

拟墨画扇 提交于 2019-12-03 07:52:54
I've merged a master branch from a friend's repository into my working directory into branch_a using: git pull my_friend master I've discovered that the merged version has errors. To continue development I would like to revert to my last commit before the merge. I tried: git reset --hard HEAD But that brought me back to the state right after the merge. (does pull command commit?!) I also tried: git revert HEAD but received the following error: fatal: Commit 2d72d8f367b987d8c16f5cb1a543a6886acdcf83 is a merge but no -m option was given. What should I do? HEAD refers to the current commit