

To restore it to its former glory, use git checkout from the last known commit, which is HEAD:īranches are powerful aspects of git, and it's common for developers to create a new branch immediately after cloning a repository that way, all of their work is contained on their own branch, which they can submit for merging to the master branch. We all do it we get a file to a great place, we add and commit it, and then we decide that what it really needs is one last adjustment, and the file ends up completely unrecognizable. This happens when you realize you've utterly destroyed an otherwise good file. A common use is to restore a file from a previous commit, and you can also rewind your entire tape reel and go in an entirely different direction. There are two ways to use the git checkout command. Where you are in the history of your Git project, much like your location in the span of a rock album, is determined by a marker called HEAD (like the playhead of a tape recorder or record player). To move HEAD around in your own Git timeline, use the git checkout command.
PULL ONE FILE FROM MASTER GIT HOW TO
In today's article you will learn how to find out where you are in the history of your project, how to restore older file versions, and how to make Git branches so you can safely conduct wild experiments.

Part 7: How to manage binary blobs with Git.Part 6: How to build your own Git server.Part 4: How to restore older file versions in Git.Part 3: Creating your first Git repository.
