Backtracking Flashcards
1
Q
How do you see the head commit?
A
git show HEAD
2
Q
If you want to discard a change to a file, how can you quickly make the file look exactly as it did when you last made a commit?
A
git checkout HEAD scene-5.txt
3
Q
What command removes file changes from the staging area?
A
git reset scene-2.txt
4
Q
How would you rewind to a commit before you made the wrong turn?
A
git reset commit_SHA
5
Q
Whats a shortcut to add every files to the directory faster, rather than adding each one individually
A
git add .
6
Q
How to delete a most recent commit, keeping the work you’ve done, and how to whereas deleting your work.
A
git reset –soft ~HEAD1
git reset –hard ~HEAD1