Can you specify which file version to go back to if you committed the file numerous times in a local machine?
For example, If I commit a file and get its first version. I make changes to it later on and commit the new changes to get a second version. I do it again with another change and commit it a third time. At this point, would I be able to go back to the first version? Or am I stuck at only have two versions (2nd and 3rd version) at a time and I'm only able to go back to the second version.
I've gone through this section in the git course, but I'm not sure if I missed a lesson where this is a possibility
You can go back to any version. Say your last three commits change the same file:
f116d82 third version 18bdc5d second version a65d770 first version
If you want to go back and have the first version, you can go back to that version using the specific SHA:
git reset --hard a65d770
Haven't found this specific case to happen often in real life, though. It's more common for me to revert the changes of a commit to go back to a previous version. Hope this helps