How to Checkout a single file from a Different Branch

Опубликовано: 30 Декабрь 2024
на канале: A shot of code
822
15

2 ways we could go about this:

1) Use GIT Checkout branchname -- filename
This will update both the working folder and the staging area with the specified file

2) Use GIT Reset branchname -- filename
This will only update the staging area with the specified file

With the aid of VisualGit we look into the differences between the two approaches of Git Reset and Git Checkout. VisualGit allows us to see the live changes to the working area, staging area and the repo as we issue each of these commands.

Feel free to try it yourself at https://visualgit.net