@46:48 To get the file back via git you would need to (1) use "git log" to get all the commits and after getting commits (2) select the SHA before the file in which git was deleted, and then (3) git checkout . You will get your deleted file back in your working directory, but from there you would need to start a new branch. OR You could just rebase
Those are good tools but it can be far easier than that as long as you have not committed yet. If you just wan't to roll back the point after the system "rm" but before and/all "git add"s, i.e. still no working file but not staged either, use git reset --mixed (default action, anyway). "Mixed" wont change the working directory, only the staging-area (aka index). If you want the ENTIRE working directory to exactly match the present branch commit then "git reset --hard" will do that. The problem with reset is you may want to be a bit more surgical, file-wise, about what you are doing as you may have several items staged and you just want a file or two back. Be careful with "--hard' since all changes, not just one or two, are lost. In the case in the video this would be fine. The delicate way is "git checkout -- new-feature2.rb" as this will grab that one file, leaving all others intact. That double-dash is the key. This can be a list of files too. "git checkout -- " is not limited to just HEAD (head being the last commit of the checked out branch) and that means you can pull your lost file from any point in history. Three weeks ago---no problem! (as long as it was committed at some point) You can use "git log" or "git reflog" to find a commit hash, branch or tag and use something like "git checkout yeOldTag -- new-feature2.rb". Once the file is back just add and commit as usual.
Been using Git for 8 years. I guess this is the first time I am actually relating all the commands I use with what is happening behind the scene. The idea of not mixing git branch with a tree like branch is the key here.
using " git cat-file -t " for showing the type of the object and " git cat-file -p " for showing the content of the object was more useful to me than using " git show"
I achieved the same style of the terminal with zsh, oh-my-zsh and gnzh theme of oh-my-zsh you guys do need to change that symbol to circle as default theme has an arrow as a symbol
There is a charge for private repos but it should work. It works fantastic for any text project including scripts. Helps on solo projects but would be invaluable when working collaboratively with a few or many authors/writers/producers. Deals well with markup like Markdown, LaTeX, Docbook, Lout, troff/groff/nroff, HTML, etc. so the document has consistent formatting throughout.