Will Will - 1 year ago 212
Git Question

GIT Discard any changes I've made to a branch

I'm working in a branch ("design") and I've made a number of changes but I need to discard them all and reset it to match the repository version. I thought

git checkout design
would do it, but it just tells me I'm already in branch 'design' and that I have 3 modified files.

How would I discard those changes and get the branch as it stands now on the remote server?

Answer Source

Note: You CANNOT UNDO this.

Try git checkout -f this will discard any local changes which are not committed in ALL branches and master.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download