2010-06-28 42 views
1

在我的仓库我使用Git svn的将其还原为提交文件

$ git branch -a 
* master 
    remotes/git-svn 

现在我可以看到

$ git diff --name-status remotes/git-svn 
M  global/library/Exception.php 

的差异如何能恢复的修改时,有2支? 感谢

回答

2

试试这个:

# create new branch (just in case you have some modifications in master branch) 
git checkout -b revert_wrong_commit 
# svn switch 
git reset --hard git-svn 
# undo last commit (takes the patch from the commit and unapplies it) 
git revert HEAD 
# commit the reverted changes 
git commit -a 
# switch to master branch 
git checkout master 
# merge the changes from revert_wrong_commit branch 
git merge revert_wrong_commit 
相关问题