Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Git - reset local changes

Posted on 2016-09-01
1
Medium Priority
?
205 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 2000 total points
ID: 41781502
Do a git checkout - this will obtain the files from the git repository again.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

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…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
How to create a branch, fetch changes, and merge them into another branch using the EGit plugin for Eclipse.
How to commit changes, push them to a remote repository, and pull them from another location using the EGit plugin for Eclipse.
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

580 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