简体   繁体   中英

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

Now 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} .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM