Reputation: 1109
I'm working on a large project that has a 'develop' branch. The develop branch is hooked up to our development server/environment. I recently made some changes that have been pushed to the develop branch, but I want to go back to before those changes to test a certain piece of functionality out. I'm wondering what the least destructive way to do that is. Ideally, I'd just like to revert the branch to that commit for a few minutes, and then return it to my current commit afterwards. I'm using Github.
Upvotes: 0
Views: 67
Reputation: 3509
You can use git checkout <commit>
to put your working directory in the state it was at any commit. This will not update the HEAD of your develop branch and you can just move back there with a git checkout develop
.
You can find out what the sha1 of the commit you are searching is with git log
.
Upvotes: 2