Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
courses
Git course
Commits
dc7975de
Commit
dc7975de
authored
Jun 20, 2014
by
bow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "git --checkout -- ." command
parent
df62604c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
basics/basics.tex
basics/basics.tex
+37
-0
No files found.
basics/basics.tex
View file @
dc7975de
...
...
@@ -187,6 +187,43 @@
\end{lstlisting}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Undoing changes.
}
Keep in mind that ``
\bt
{
git reset
}
'' by default sets a staged file back to unstaged.
\begin{lstlisting}
[language=none, caption=Unstage a file.]
$
git reset README
$
git status
# Changes not staged for commit:
# modified: README
\end{lstlisting}
\bigskip
\pause
To discard all changes in an unstaged file, you can use ``
\bt
{
git checkout
}
''
\begin{lstlisting}
[language=none, caption=Discarding changes.]
$
git checkout
--
.
$
git status
nothing to commit, working directory clean
\end{lstlisting}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Undoing changes.
}
For now, let's commit our change and move on.
\bigskip
\begin{lstlisting}
[language=none, caption=Adding a new version of a file.]
$
echo Second version. > README
$
git commit
$
git status
nothing to commit, working directory clean
\end
{
lstlisting
}
\bigskip
\end
{
frame
}
\begin
{
frame
}
[
fragile
]
\frametitle
{
Viewing the history.
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment