Skip to content
Snippets Groups Projects
Commit dc7975de authored by bow's avatar bow
Browse files

Add "git --checkout -- ." command

parent df62604c
No related branches found
No related tags found
1 merge request!3Updates bow
......@@ -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.}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment