Lets say, I don’t have access to github. How is my local repository useful to me? Can I roll back files to early versions? If so, how is it done?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your local repository contains a full history. This is easily seen by launching
gitk, a graphical explorer of your git history.To get older versions of files, you can use for example
git checkout <revision> <file>. For examplegit checkout HEAD^ foo.txtwill give you thefoo.txtfrom the previous revision.Another way of exploring old versions of files is
git show <revision>:<path>which will show you the old contents of the file in a pager instead of checking it out into your working tree.The only commands that access other repositories (github in this case) are
git push,git pullandgit fetch. All other git operations work solely on locally available information.