Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If you have a branch like this
- Master
- 7243798 M
- 60789fc M
- 4c629bb M
- And you push 6bbw138 commit by mistake to Master your result will be:
- Master
- 6bbw138
- 7243798 M
- 60789fc M
- 4c629bb M
- If you want to come back to 7243798 or previous
- 1) on local repo go to your master branch:
- git checkout master
- 2) Then we need the commit id to do a a reset of master branch in our case 7243798
- git reset --hard 7243798
- 3) We need to push this change to our branch, in our case is master branch
- git push origin master -f
- I used bitbucket repo, this will be the output
- Total 0 (delta 0), reused 0 (delta 0)
- To bitbucket.org:square1/www.myrepo.test.git
- + 6bbw138...7243798 master -> master (forced update)
- And that's it you will have your branch on the previous commit.
- Master
- 7243798 M
- 60789fc M
- 4c629bb M
Add Comment
Please, Sign In to add comment