Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Git - reset local changes

Posted on 2016-09-01
1
Medium Priority
?
170 Views
Last Modified: 2016-09-10
I have done some local changes in code stored in Git repo. I don't need these changes anymore, so I would like to discard them and get a clean copy from github.

When I did a Git pull it gave me a merge conflict error.

So, I did

git reset --hard

but that did not help. I also tried

git stash

but still when I try pull from github, it does not allow me to do so.

Can someone please suggest what would be the best approach to get the latest code from github. Should I just delete the local files and then do a git pull?
0
Comment
Question by:ank5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
LesterClayton earned 2000 total points
ID: 41781502
Do a git checkout - this will obtain the files from the git repository again.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: gr8gonzo
Git can be a complicated version control system for beginners, but it definitely is one of the best ones out there. Since this article assumes that you're starting at square one, it will skip over things that Git -can- do and will focus on the typic…
To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
How to create a Git repository using GitHub, and how to clone and checkout the repository using the EGit plugin for Eclipse.
Explains the Git Index and the differences between a Remote, a Remote Tracking Branch, and a Local (or Tracking) branch.
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question