Skip to content

Revert the local copy of a repository to the current version fo the code on the cloud

frakkopesto edited this page Apr 19, 2013 · 2 revisions

This is a specific example of how we can change the status of the code locally to represent the code on the cloud (upstream master.

Scenario: Let's say we have an issue with the local version of the repository. Something is failing. We do not know whether the latest changes in the local repository are generating this problem. This repository was not yet pushed and pulled into the master on the cloud. So we can checkout (download) whatever is on the cloud and use that code to see if we broke anything with out latest changes.

  $git checkout upstream/master -b upstream_master_test

The previous command created a new local branch of the repository. The option '-b' creates the new branch with the given name. The 'checkout' command indicates which code will be in the repository. In this case the one from the cloud (upstream/master).