1

i have the below commands to update my repository, which will update my library using TortoiseSVN and source with Git.

But i want to undo all the changes i made and replace it with what's there in the master repo.

cd lib\win64_vc12
svn update
cd ..\..\project
git pull --rebase
git submodule foreach git pull --rebase origin master

I researched and found its

git reset --hard origin/master

but i am not sure,how i do it with this,i am new to git, i don't want to re-clone the repo,as its huge.

Need your kind help,thank you

Abhijith

abhijith
  • 11
  • 1
  • 1

2 Answers2

0
git reset --hard 0d1d7fc32

will reset you to the desired commit and all the changes will be lost so be care full while doing it.

vivek verma
  • 1,716
  • 1
  • 17
  • 26
0

But i want to undo all the changes i made and replace it with what's there in the master repo.

The simple way is simply to delete the "dirty" branch and checkout the new branch from your local repo

# delete the local master branch
git branch -D master

# checkout the latest branch without the need to clone the repository again
git checkout origin/masetr

What else can you do to fix it?

You have to set up your HEAD to point to a new (or old) commit.
The above post will show you and will teach you what to do and will show you few options.

If you want to undo your changes. Do do so you have several options, which you can read about in details in here:

How to move HEAD back to a previous location? (Detached head)

It will explain in details what to do in each option.

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167