Solved

Git - reset local changes

Posted on 2016-09-01
1
60 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
1 Comment
 
LVL 18

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I access these files? 2 120
how to build tree like directory structure in git 1 87
Github: clone original - keep original - good practice? 9 115
Team Foundation Server 8 61
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…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
How to create a branch, fetch changes, and merge them into another branch using the EGit plugin for Eclipse.
How to create a Git repository using GitHub, and how to clone and checkout the repository using the EGit plugin for Eclipse.

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now