| |
|
Explain all things about Git Reset and syntax?
Git reset is like Git revert is a tool used to undo changes. And Git reset has mainly three primary invocation forms and have three command-line arguments as given below:-
(1)--soft
(2)--mixed
(3)–hard
The arguments in turn is correspond to Gits three internal state management mechanisms as given below:
(1)Commit Tree (HEAD)
(2)Staging Index
(3)Working Directory
And here Git reset moves the repository back to an earlier commit and also used to delete any changes made after the commit in question.
And Programmers can perform a Git reset revert by using below code or syntax:-
git reset
And this action removes the named file from the staging area, and the working directory remains unchanged. However, if we want to reset the staging area so it matches the most recent commit while leaving the directory untouched we use below command or syntax:-
git reset
But one thing to be taken care that Git reset is one of the few Git commands that risk the user losing their work and it can undo local changes in both the Working Directory and the Staging Index. | |
|
|
|
|