Last active
March 14, 2017 18:25
-
-
Save nunomorgadinho/7b315844c7c4be35a806784de47a5159 to your computer and use it in GitHub Desktop.
Rollback para um determinado commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1-Check out the branch you made the mistake on | |
# 2- Right click on the commit you want to reset the branch to | |
# 3- Click "Reset current branch to this commit" | |
# 4- Select "Hard" mode and click "OK" | |
# 5- Unfortunately you need terminal to do this bit. Type git push origin name_of_branch --force into terminal (you may need to enter your git repo username and password for it to accept the command) | |
git checkout staging | |
git pull origin staging | |
# identificar o commit para o qual se quer voltar: | |
# fazer git log e ver a hash | |
# e.g. se for commit f3abda6df7fabfb9843734af5295e78c31468362 | |
# a hash é f3abda6df7fabfb9843734af5295e78c31468362 | |
git reset --hard 60cfaa16083dd2151b9f41bd2562b514160317dc | |
git push origin staging --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment