Hello, Jim.
Today, we're going to have super interesting topic and this last one, I'll show you how you can restore
literally everything.
What was ever present in any snapshot in it, even if it was overwritten, is by force push or hard
reset.
But I will run such command as gets where flock.
We're going to understand when and why we have to use.
It will imitate cases when we lost some changes and we need to restore them.
After this lesson, you will be able to use reflood command with different options and variations.
Like a pro, you are going to learn how to restore lost command in the new branch or reset current branch
to the committees that were lost.
Let's understand first, why do we need to use lock and what problem it may help us to solve?
It may happen that at some point during your journey you may accidentally lose a command.
Like I told you before, it may happen during the force delete of your work or during the hard reset
or you use interactive rebate's to squash commands and the resolving of conflicts during the invasion
went wrong and some changes were lost.
So how to get those changes back in if something were ever committed, might be restored, yet won't
be able to restore files that were never in the staging area and were never committed before.
I suggest that a lot of the kids were locked directly from the practical exercise.
Let's start to show you how to restore changes.
Let me intentionally lose some data.
I'm on the master branch.
Let me show you.
Let latest Kummetz gate log dash three.
Let me Hardell said Doulos commits yet reset hard had yielded to OK the branches reset.
Let's check commit history Dedlock.
Now we can say that we lost to commit, OK, there is no harm for me to restore the changes from the
region branch, but it might happen that a regional branch was also accidentally overwritten or completely
removed.
You won't believe me, but such cases may happen.
At the first glance, it looks like that I only need to remember to check some of the lost comments,
but we didn't memorize them.
Agree the most complicated in this task to learn.
Check some of those comments.
And the easiest thing to answer this question is to call it red flag.
Come on, what is a red flag?
As we are working with gait and movement pointers get silently records.
What is our head pointer and how does it look like?
That means that each time we are creating a new snapshot or switching branches, the red flag is updated.
You can investigate the history of all changes in your repository by executing the next command gateway
flock.
We can see information about each operation that was done here about each commit, each research on
the region must have branch.
You can find information here about different branches by the reference in the parentheses.
Also, you may find checksum of each state right here.
By the way, this is the last program.
This is a program for text terminals, for Unix like systems to close it.
Just press Kyuki to remember it.
Q stands for it.
Here, let me press Q.
OK, Hillary.
So where's the place where you can get check some of the comments that you want to restore?
I know that for some students, the way our flag looks like is not very informative.
We can't see the detailed content messages we may find on the description of the operation, but not
the details about the commit.
What would I suggest to you is to use the next command get look with option G here you may find a list
of all commits was a red flag reference.
Here is our committee that we have lost.
Let me create a new branch with the state of that snapshot.
Yet Branch lost changes.
And now I have to specify, commit checks that I want to restore E 50, be a D great.
Now let's check commit history, get log last changes.
Just to remind you to check the current history of the specific branch, we should specify branch name
next to log command and we can see that our new branch contains commands that were lost.
So as far as you may understand, you can restore, Anderson, what was present in any committee in
your local repository or anything where hat pointer of your local repository ever pointed to.
Also, one more important note.
By default, information in red flag is stored for 90 days.
Usually it is enough.
It is very unlikely that you lived your happy life for 91 days and after that realized that you need
to restore some lost command.
Let me show you one more Syntex of restoring changes.
I'm on the massive branch and I didn't switch to the new branch with the name lost changes that we created
with the last comment on the massive branch.
I still don't have my last comments after the hard reset.
Let me reset was hard to Morcom.
It's back here is our leaders had hard to prove that we really moved a few comments back and that we
have lost even more comments.
Let me show you commit history.
You'd log that story and you can see that we lost our five zero beard commit.
Let me show you one more time that shows a whole raft.
Look, let me show you the flag.
Only for the past one hour traffic was option since equals to one our.
And I see limited amount of red flag you can use day instead of hours if you wish.
So here is a state of our head pointer before I set it.
Has Index had at nine and two.
That's the sad state of the current branch to the opposition leader, said resorption, hard hat and
to unlet.
Check our comment history one more time gridlock.
And here we are.
We successfully restored state of our filesystem and state of our branch.
That was before the last reset.
I believe this information will help you a lot in the future.
That's all what I planned to share with you today.
Let's recap what we have learned today.
So today we learned what a leader travelogue is.
Now you know how to use this command during the lesson.
We restore our lost commits by creating a branch from then lost it all by yourself in the current branch
to the previous state before some comments were lost.
Also, we learned how to show red filtered by time passed.
That's all what we have for today.
Thanks a lot for your attention.
See you in the next lesson.