Skip to content

Commit

Permalink
Adding git reflog information (dipakkr#733)
Browse files Browse the repository at this point in the history
* Adding some information on the git reflog to git-cheatsheet.md

* Adding some information on the git reflog to git-cheatsheet.md
  • Loading branch information
mo-ward authored and Contrevien committed Oct 28, 2018
1 parent 61f44c4 commit bb308bb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions git-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Learn about version control and keeping your projects organized with this Git ch
13. [Releases and Version Tags](#13-releases-and-version-tags)
14. [Collaborate](#14-collaborate)
15. [Archive / Troubleshooting / Security](#15-archive)
16. [Reflog](#16-reflog)



Expand Down Expand Up @@ -426,6 +427,24 @@ Create a zip-archive: `git archive --format zip --output filename.zip master`
Export/write custom log to a file: `git log --author=sven --all > log.txt`


### 16. Reflog
----------
#### Often useful when needing to recover "lost" references as it tracks your reference history rather than your commit history.

View all changes to HEAD:
`git reflog` or:
`git reflog show HEAD`

View all changes to a branch:
`git reflog show <branch>`

View all changes to a stash:
`git reflog <stash>`

Additionally: `git reflog show` is an alias for: `git log -g --abbrev-commit --pretty=oneline`, and accepts the same options as `git log`

Further information: https://git-scm.com/docs/git-reflog

Troubleshooting
-----------

Expand Down

0 comments on commit bb308bb

Please sign in to comment.