Tuesday, June 17, 2008

Undo uncommitted changes in git

It seems that 'git revert' does not work the way that 'svn revert' does (reverting all uncommitted changes). I don't know if this is the proper way, but I 'reverted' my changes using 'git stash':


git stash
git stash clear

Update:

git reset --hard

6 comments:

Anonymous said...

If you don't want to throw away all changes, just some files, try `git checkout FILES...`.

jorrel said...

@arlen Thanks for the tip!

Matt Di Pasquale said...

sweet thanks.
git checkout file.txt

worked! :)

Ahmed said...

Thanks, it worked.

temposys said...

thx. works!

mohit abram said...

Hello everyone, really dreams do come through, i no longer have to apply for loans and worry over my bad credit scores, i got my blank ATM card after so many trails all thanks to Mr George, if you are thinking if its actually real the answer is YES. Mr George is very good at his job i applied for the card and got it shipped to my country 5 days later and i have been using the card for two months its totally untraceable, my life has transformed from paring an apartment in the slums to purchasing an executive condo with luxury furniture's and now my children can now attend quality schools, Mr George is an angel sent from God to the poor and needy. i am writing this with tears of joy as Mr George has removed my family from the life of want to the life of satisfaction. you can contact him through this email: blankatm402@gmail.com
BEST WISHES