# git log --oneline
97c32d3 (HEAD -> main, origin/main, origin/HEAD) teste
044bd22 new test
afb058c Initial commit
# git log --pretty=short
commit 97c32d37441916d3918c7e579767b32879eaec53 (HEAD -> main, origin/main, origin/HEAD)
Author: Amaury Borges Souza <[email protected]>
teste
commit 044bd22abfe1fa3a468507133e98ee322c746cbc
Author: amaurybsouza <[email protected]>
new test
commit afb058c4b0dacda07266578df6e670a999d86115
Author: Amaury Borges Souza <[email protected]>
Initial commit
- First of all, you need check a
git log
command to check the log of commits
# git log
Now you can proceed:
# git revert 011b2e306e2edf968820a44b38a5d52d9772c0a
OBS: for good practices, NEVER change the history on the master, always use git revert
command, it's don't change the history.
# git reset - used to separeted branches
# git revert - used to on the master
# git push origin master --force - used to force the push
# git commit --amend - used to change the last commit message (do this before to push to remote repository)
# git cherry-pick 011b2e306e2edf968820a44b38a5d52d9772c0a - used to get the commit message from another branch