Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Git - reset local changes

Posted on 2016-09-01
1
Medium Priority
?
193 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

INTRODUCTION Subversion is a fantastic version management and software configuration management tool for teams and individuals to manage software applications. It offers many advantages over it's CVS ancestor such as it's built-in compatibility w…
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…
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.
Suggested Courses

916 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