Git pull undo misoperation

git pull undo error

originally wanted to merge the newpbft on github into the local newpbft branch. Since I did not check the current branch, I directly used the git pull origin newpbft, but the newpbft was merged into the master branch.


1, run the git reflog command to view your history of changes, as follows:

fdb70fe [email protected]{0}: pull origin newpbft: Fast-forward
40a9a83 [email protected]{1}: checkout: moving from guan to master
b3fa4c3 [email protected]{2}: commit: copy from newpbft, first init
71bf0ec [email protected]{3}: checkout: moving from newpbft to guan
71bf0ec [email protected]{4}: commit: 1. add moveStore() to clean up certStore and blockStore.
1006d67 [email protected]{5}: commit: 1. Add PBFT branch to Puppeth.
fa3fb56 [email protected]{6}: commit: 1. change some errors about packages and vars
5f40fdc [email protected]{7}: checkout: moving from master to newpbft
40a9a83 [email protected]{8}: clone: from

2, then use git reset --hard [email protected]{n}, (n is the reference to which you want to fall back) to fall back.

For example, in the figure above, git reset --hard 40a9a83

Read More: