1

I have git-setup with a remote 'origin' repository, and local repositories on my work desktop and laptop.

Now I did some work on my laptop last night, and pushed it to the remote.

Now I want to ignore / overwrite the changes I made on my desktop, and pull the remote 'origin' down as fresh copy - like when you first clone a repository.

Martijn
  • 15,791
  • 4
  • 36
  • 68
wobbily_col
  • 11,390
  • 12
  • 62
  • 86
  • I had a feeling someone would have asked the same thing, but didn't find it in my search. – wobbily_col Mar 27 '14 at 10:03
  • Yes, that's exactly what I was looking for Charles, thanks. How do I close the question now, or accept the answer from the other question? – wobbily_col Mar 27 '14 at 10:05
  • You can't accept the answer of other question, because it's already accepted, but you can upvote it (both question and answer). Your question will get closed when 3 more people will vote for closing – CharlesB Mar 27 '14 at 10:37

1 Answers1

0

The following command will reset your current working directory to the last commit. Be warned though as it will remove all your local changes.

git checkout -- .
git pull

I can really recommend reading the pro git book as it covers all the basics of git really well.

http://git-scm.com/book

Sedrik
  • 2,161
  • 17
  • 17