Uncommited files in git repo: how to reject local changes

It has happened to me a few times: I do local changes and test stuff locally. Then I come back a while later (weeks) and I have forgotten what were the changes for. In order to play it safe, I want to reset my local files to what is there on the github repo, so here is the solution

http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull

git fetch --all
git reset --hard origin/master

 Thanks RNA!

Advertisements

One thought on “Uncommited files in git repo: how to reject local changes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s