开发者

Git : How to revert bulk commits on multiple repos

To update my multiple repos, I did:

git bulk fetch origin
git bulk pull origin master

开发者_如何学JAVANow it appears that some of the functionality which was working initially is not working now and so I want to revert back to previous state of my repos.

How can this be done ?

I tried doing git reset --soft commit id & git reset --hard commit id for one repos but it is not working.

Any suggestions.


You can use git reflog to revert your repo to your old state.

You should see something along the lines of:

git reflog
bb3139b... HEAD@{0}: pull : Fast forward
01b34fa... HEAD@{1}: clone: from ...name..

Use a git reset --hard to reset the repo to the SHA1 read from the git reflog.


Note: Another way, instead of using git-reflog and copying SHA1 reference, is to use a revision specification: master@{1}, which is the previous position of master, master@{"5 minutes ago"}, or master@{17:30}.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜