HowTo: Pull Specific Commit from Bitbucket with Git

The advantages of coding using a subversion repository is that you can always go back to an old commit. This comes in handy specially when you need to go back in order to correct an issue caused by a recent commit.

A simple way of changing your setup back to an old commit is to create a new branch, switch to that branch by checking out your files, and doing a $git reset from the specific commit in Bitbucket so you continue committing from XXXXXX commit, where XXXXXX is the old commit you wish you go back to, like this:


$git branch newbranchname
$git checkout newbranchname
$git reset XXXXXXX --hard

Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *