Reputation: 130
I want to discard the local changes I made in an Android Studio project.
I tried to perform a pull, the GUI gives me 5 options, which option should I choose?
Upvotes: 3
Views: 9958
Reputation: 198
In Android Studio do the following:
-Open the Version Control tool window Alt+9 and switch to the Log tab.
-Select the recent commit and right click on it than select Reset Current Branch to Here.
-A Git Reset popup will open -> select Hard -> click Reset
Upvotes: 6
Reputation: 584
In Android studio do the following:
Go to VCS -> Git -> Reset HEAD
Change Reset type to hard
Upvotes: 2
Reputation: 489293
You originally asked which strategy argument to use with git pull
to discard your own work (there is a pending edit that will change the question, if the edit is approved). The answer is: None.
Don't use git pull
at all. Run git fetch
first:
git fetch origin
This brings over all the new stuff from the other Git you have your Git calling "origin".
Now that you have everything they have, simply stop using what you have been using, and switch to theirs:
git reset --hard origin/master # assuming you're on your "master"
You may also want to use git clean -fdx
to remove build artifacts, but that's a separate issue.
Upvotes: 2