revert

Can't seem to discard changes in Git

感情迁移 提交于 2019-11-26 12:04:49
问题 After seeing the following from the command line: # On branch RB_3.0.10 # Changed but not updated: # (use \"git add <file>...\" to update what will be committed) # (use \"git checkout -- <file>...\" to discard changes in working directory) # # modified: index.htm I am trying to discard my changes by typing the command: git checkout -- index.htm but when I re-run git status, it looks exactly the same. The checkout doesn\'t seem to be working. Am I doing something wrong? I am using GIT 1.6.1.2

Mercurial — revert back to old version and continue from there

梦想与她 提交于 2019-11-26 06:52:32
问题 I\'m using Mercurial locally for a project (it\'s the only repo there\'s no pushing/pulling to/from anywhere else). To date it\'s got a linear history. However, the current thing I\'m working on I\'ve now realized is a terrible approach and I want to go back to the version before I started it and implement it a different way. I\'m a bit confused with the branch / revert / update -C commands in Mercurial. Basically I want to revert to version 38 (currently on 45) and have my next commits have

How do I revert an SVN commit?

谁说我不能喝 提交于 2019-11-26 04:04:06
问题 I have found various examples of how to revert an SVN commit like svn merge -r [current_version]:[previous_version] [repository_url] or svn merge -c -[R] . But neither of them seems to work. I tried those commands and checked the files that were changed by hand. How do I revert a commit with revision number 1944? How do I check that the revert has been done (without looking in the actual file to the changes have been reverted)? 回答1: Both examples must work, but svn merge -r UPREV:LOWREV .

Remove specific commit

陌路散爱 提交于 2019-11-26 03:01:37
问题 I was working with a friend on a project, and he edited a bunch of files that shouldn\'t have been edited. Somehow I merged his work into mine, either when I pulled it, or when I tried to just pick the specific files out that I wanted. I\'ve been looking and playing for a long time, trying to figure out how to remove the commits that contain the edits to those files, it seems to be a toss up between revert and rebase, and there are no straightforward examples, and the docs assume I know more

How do I revert all local changes in Git managed project to previous state?

痞子三分冷 提交于 2019-11-26 02:39:04
问题 I have a project in which I ran git init . After several commits, I did git status which told me everything was up to date and there were no local changes. Then I made several consecutive changes and realized I wanted to throw everything away and get back to my original state. Will this command do it for me? git reset --hard HEAD 回答1: If you want to revert changes made to your working copy, do this: git checkout . If you want to revert changes made to the index (i.e., that you have added), do

How do I “un-revert” a reverted Git commit?

坚强是说给别人听的谎言 提交于 2019-11-26 02:04:14
问题 Given a change that has been committed using commit , and then reverted using revert , what is the best way to then undo that revert? Ideally, this should be done with a new commit, so as to not re-write history. 回答1: If you haven't pushed that change yet, git reset --hard HEAD^ Otherwise, reverting the revert is perfectly fine. Another way is to git checkout HEAD^^ -- . and then git add -A && git commit . 回答2: git cherry-pick <original commit sha> Will make a copy of the original commit,

git status shows modifications, git checkout — <file> doesn&#39;t remove them

一个人想着一个人 提交于 2019-11-25 23:24:56
I would like to remove all changes to my working copy. Running git status shows files modified. Nothing I do seems to remove these modifications. E.g.: rbellamy@PROMETHEUS /d/Development/rhino-etl (master) $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: Rhino.Etl.Core/Enumerables/CachingEnumerable.cs # modified: Rhino.Etl.Core/Pipelines/SingleThreadedPipelineExecuter.cs # modified: Rhino.Etl.Tests/Rhino.Etl.Tests.csproj # modified: