Reset local repository branch to be just like remote repository HEAD

How do I reset my local branch to be just like the branch on the remote repository? I did: git reset –hard HEAD But when I run a git status, On branch master Changes to be committed: (use “git reset HEAD <file>…” to unstage) modified: java/com/mycompany/TestContacts.java modified: java/com/mycompany/TestParser.java Can you please tell me why I … Read more

How do I undo the most recent local commits in Git?

I accidentally committed the wrong files to Git but didn’t push the commit to the server yet. How can I undo those commits from the local repository? The only way seems to be to copy the edits in some kind of GUI text editor, then wipe the whole local clone, then re-clone the repository, then … Read more