Essential Git Commands

Essential Git Commands

Messed up with your local working tree, revert to the current HEAD (scope: all files)

b96123@linux10 [~/workspace/scripts] git reset --hard HEAD
HEAD is now at ace4899... init release

Checking out an old version of a file

How to overwrite a local file with the current (HEAD) file in the git repository (in svn you would do: rm localfile; svn update)?

b96123@linux10 [~/workspace/scripts] git checkout HEAD bash-for.sh
git
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License