Lot of the students in this lesson, we're going to talk about how you can undo things and adjust your
comments and we'll learn the basics of work and search console text.
Ed, as we in this lesson on real examples.
I'm going to show you how you can amend last comment, how to on stage files, if needed, more, longer
to restore command and how you can use it to restore state of files.
Also, I will show you how you can use tab for out to completion and get the brush to save your time
on typing words.
I will show you your basics of work in concert next week.
And as usual, let's practice.
I will open our project which we create.
OK, imagine that we need the command, but we forgot to include one more file or another.
Could change in that comment.
We can easily amend the last comment, but be careful.
Today we are going to learn one of the few errors and get where you may lose some work if you do it
wrong.
And changes.
We have to use the next command gate, commit double dash amand amant option takes current staging error
and uses it for the commit.
In case you have nassan staging area and the only thing you want to change is the commit message, then
just use this command.
For example, let me show you the message of our last week long dash.
One end of the gate ignore and removed from station.
That is our last message that we did on the previous lesson.
OK, now let's change it yet.
Commit double dash amand.
I had updated word at the beginning here, text editor is opened, just to remind you, not part is
open because I said not, but as a default text editor in global conflicts here, I can change message.
I press control and ask to save the file and close it.
Now let's check the last comit message.
And you can see that message is updated just in case not all students change the full text editor.
Let me show you what potentially you can see by default.
It bash users with text editor.
So in case you didn't change the full text editor, you're going to see unusual for you, text editor.
Let me change my global settings to demo this.
Do you get config demo Desh, Global Core Editor V.
Now, let me amend it myself one more time, which is a very powerful program that supports many cool
features.
Unfortunately, this course is not about me and I am not joking.
It is really possible to pass a course for the editor to learn more about it.
But I will show you now the basics so that you could navigate here just in case you forgot to change
the full text editor.
First of all, for cursor navigation, you have to use the next case out to move cursor to the right
just to move cursor down h to move cursor to the left, K to move cursor up.
The text editor has two modes command line mode and insert mode.
Let me show you on the example level of cursor after updated virt.
Now I need to switch to insert mode.
I need to press I key.
And you see here in the bottom we see insert words.
That means you're in the insert mode.
Now I can use backspace and all the keys to change the message.
Let me remove updated and write the editor test.
Now I have to say file and close it to do this, I need to switch with editor in command line mode.
I press escape button, you can see that there is no more insert is written down here to save changes
and exit.
We I have to type next column W and Q W stands for Right U stands for Quitte Press enter.
Now let's check our current message and receive that message is changed.
Awesome.
Now you understand what I meant when I said that we text Ed will be a bit unusual for you to use.
That's why.
Let's return back notepad as the default text editor.
OK, now let's imagine you forget to add some changes, let me add more spaces in the source code file.
Then I added the staging area get at DOT.
And now I want to adjust my last command so that it includes the latest changes and I don't want to
change comit message what I have to do, I have to perform next command, get commit double dash meant
double dash, no added.
And press, and here it is, let's check our combat history.
You can see that checksum is changed.
This is important just to remember that each time you do commit or just commit checksum, it's changed.
Later, I will show you one real example, why it is so important.
Now, I'd like to discuss with you next, Tenaris, that we create a new file, images, that we have
some important conflicts.
Let's create this file, watch some important conflicts, dot the 60, also edit changes to the existing
source code and put some new lines here.
And they added old files to the staging area.
Yet at DOT, now let's check status status.
Here's a new file and here's the existing one.
And I just realized that I don't want to have the one come with changes in the hello file and important
conflicts together, because logically that should be two different snapshots.
How I can stage changes and remove from the staging area files that I don't need.
Always remember to read, get hints, pay attention here use get restored about Desh staged file two
on stage.
Let's follow this hint it restore the modish staged SAAC slash and press stop key that provides us with
the auto completion so we won't waste our time on typing.
Press enter.
Let's check its status and we see that kilovolt file was removed from the staging area and wasn't removed
from my file system.
Also all changes are there on place.
Perfect.
I can create comment right now only with these changes and after that I can add to the stage a new file
and committed.
Awesome.
What if I want to discard changes?
Let's follow him from get here to discuss changes.
I have to type git restore and file name.
OK, let's do that git.
Restore a thirty slash and pressed up to autocomplete.
Hello World Java.
And now we can see that changes were averted great.
The one thing while I get the most is that everything what was committed can be recovered, even changes
that were done with the help of gift commitment commands.
Later in this course, I'll show you how you can use the travelogue to restore literally avarice and
what was ever committed.
However, the changes which should discard without committing is not possible to restore.
So be very careful.
That's all what I wanted to share with you today.
Let's recap what we have learned today.
Today we learned how to amend last comment.
We also learned how to change can message if you want.
So you saw the text editor and learn the basics to work in the editor.
Also, we learned how to use step for auto completion.
Now you know how to stage some changes and how to restore state of the file to the original state since
the last comment.
That's all for today.
Thanks a lot for your attention and see you in the next lesson.