As a result, now our project has two versions. One is without salary and another is with salary.
Current status is each employee has their salary in that text file. Now we will get the earlier version of Employee.txt file. Where salary not available.
Current File Data - with salary
Step 1: Go to git bash and see the all commit log by the below command. We can use two commands. The first command (git log) is shows with author details and date time. And second command (git log --oneline) only shows the commit ID and comment in a single line.
git log
or
git log --oneline
fe0bed1 (HEAD -> master) My commit - Salary Added
21b75c7 My comment - First Commit
21b75c7 My comment - First Commit
See here (fe0bed1, 21b75c7) are the git unique commit id. Using this unique id we are able to get back the each version of commit.
Step 2: Now we will get the first version of Employee.txt file using this (21b75c7) commit id.
Command -
Here it has been moved to the earlier version of the Employee.txt file. Below is the current data inside Employee.txt file. Which are earlier versions (without salary).
0 Comments