wkde
wkde

Reputation: 453

How to change git checkout to original

I cloned a software with git clone.

git clone https://github.com/BinPro/CONCOCT.git

And then

cd CONCOCT
git fetch
git checkout SpeedUp_Mp

Then I got this message.

Branch 'SpeedUp_Mp' set up to track remote branch 'SpeedUp_Mp' from 'origin'.
Switched to a new branch 'SpeedUp_Mp

Then I put

sudo python ./setup.py install

Now I want to make it into 'origin' as before. So I put

git fetch
git checkout origin

Then I get an error message

error: Your local changes to the following files would be overwritten by checkout:
concoct/cluster.py
Please commit your changes or stash them before you switch branches.
Aborting

What can I do? How do I commit changes?

Upvotes: 1

Views: 958

Answers (1)

User123456
User123456

Reputation: 2738

If you want to get the original version of the branch, checkout to a new branch, delete branch with the problem in local

git branch -d SpeedUp_Mp
git fetch --all
git checkout SpeedUp_Mp

else, you could checkout all the changes you did

git checkout .

Upvotes: 1

Related Questions