将git存储库恢复到旧版本

时间:2014-05-13 09:30:29

标签: git repository

在git reposotory中推送大文件后,我遇到了一些问题。

我尝试了不同的东西弄乱了所有东西。

我试过的最后一个命令是

git filter-branch --tree-filter -f 'rm -rf FOLDERWITHLARGEFILES/*' HEAD

并且我认为我解决了这个问题因为以下

git push origin master 

的工作。

问题是现在我有一个非常旧版本的代表。我认为这是我尝试提交大文件之前的版本。有没有办法恢复存储库。

回顾一下:

我试图推送大文件。 我继续处理我的文件 我试图解决推送大文件的问题......

提前多多感谢

这是我所做的历史:

1) I pushed the last time on May the 9th
2) I modified locally the code
3) I tried to push large files so git didn't allow me
4) I did some mess trying to cancel the commits like:
     $ git filter-branch -f --tree-filter 'rm -rf FOLDERWITHLARGEFILES/*' HEAD
     $ git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch DATA/*' --tag-name-filter cat -- --all
     $ git commit --amend -CHEAD
     $ git rm --cached FOLDERWITHLARGEFILES/
     $ git update-index --assume-unchanged FOLDERWITHLARGEFILES/
5) I pushed again today and I found both locally and in the rep the code at the last correct push (point 1)

0 个答案:

没有答案
相关问题