git log -> command to display all prior commits
Press "q" to exit from that history screen
Revert to Prior Commit in Gitbash
https://ncona.com/2011/07/how-to-delete-a-commit-in-git-local-and-remote/
You can delete a local commit by doing:
git reset –hard HEAD~
Lets say there is a repository with 4 commits.
$git log --pretty=oneline --abbrev-commit
46cd867 Changed with mistake
d9f1cf5 Changed again
105fd3d Changed content
df33c8a First commit
Commit 46cd867 is the most recent commit and the one we want to delete, for doing that, we will use rebase.
$git rebase -i HEAD~2
That command will open your default text editor with your two (Change the number 2 with the number of commits you want to get)
$git push origin +
No comments:
Post a Comment