kaviranga kaviranga - 3 months ago 19
Git Question

How to rollback git in project github or bitbucket to previous version as in heroku using terminal commands?

I want to know how to rollback git project to previous version after commit. I experienced that heroku keeps activity log for web projects and has the capability of rolling back to previous version with simple options.Is this facility available for github or atlassian bitbucket ? Is there any commands for that ?

Answer

Description

Yes, both services provide such utilities. There are a number of commands that you can execute to achieve a roll-back but they all depend on the way they treat history. Please see some git signatures below and their associated references for more information.

Example

git revert <commit>
git rebase -i <HEAD~n>
git reset <commit>
git checkout <commit>

Reference

git-revert
git-rebase
git-reset
git-checkout