From a833a257e91fcd358e0953fb49b0fb54e5beaadf Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sun, 3 May 2015 10:04:38 -0500 Subject: [PATCH] Add Accessing a Lost Commit as a git til. --- README.md | 1 + git/accessing-a-lost-commit.md | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 git/accessing-a-lost-commit.md diff --git a/README.md b/README.md index 82653df..50c332e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ smart people at [Hashrocket](http://hashrocket.com/). ### git +- [Accessing a Lost Commit](git/accessing-a-lost-commit.md) - [Checkout Old Version Of A File](git/checkout-old-version-of-a-file.md) - [Checkout Previous Branch](git/checkout-previous-branch.md) - [Clean Out All Local Branches](git/clean-out-all-local-branches.md) diff --git a/git/accessing-a-lost-commit.md b/git/accessing-a-lost-commit.md new file mode 100644 index 0000000..5df2a79 --- /dev/null +++ b/git/accessing-a-lost-commit.md @@ -0,0 +1,10 @@ +# Accessing A Lost Commit + +If you have lost track of a recent commit (perhaps you did a reset), you +can generally still get it back. Run `git reflog` and look through the +output to see if you can find that commit. Note the sha value associated +with that commit. Let's say it is `39e85b2`. You can peruse the +details of that commit with `git show 39e85b2`. + +From there, the utility belt that is git is at your disposal. For +example, you can `cherry-pick` the commit or do a `rebase`.