Question: I’m using Git on Mac 10.9.5 and would like to pull down the latest version of what is in a branch. I don’t care about any local changes I’ve made — I’m happy to abandon all of those. Right now when I run

```
git pull origin branch-name

```

I get errors like

```
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
    src/main/java/com/myco/classroom/dto/ClassroomCourseDto.java
    src/main/java/com/myco/clever/dto/CleverClassroomUserDto.java
    src/main/java/com/myco/clever/exception/MissingUserException.java

```

I don’t want to commit anything — I just want to get a fresh copy free of any local modifications I’ve done. How do I do this?

Answer: 
In case you did something wrong, you can replace local changes using the command

 `git checkout --` 

this replaces the changes in your working tree with the last content in HEAD.
Changes already added to the index, as well as new files, will be kept.

If you instead want to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it like this

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

Visit this site if you need more help with git: <http://rogerdudler.github.io/git-guide/>
If you don't mind losing any changes, you can also `git checkout` the files with changes, but that could take more time depending on the amount of changes you've made, and it won't save the changes for future reference like `git stash` does.