Question

I did a git reset -hard FETCH_HEAD before and I can't figure out to get back to my latest commit.

HEAD@{0}: checkout: moving from master to adding_events
HEAD@{1}: checkout: moving from adding_events to master
HEAD@{2}: checkout: moving from master to adding_events
HEAD@{3}: checkout: moving from 3458u9qfhaushf
HEAD@{4}: commit: Testing Gemfile edit
HEAD@{5}: checkout: moving from master to fajesnfkj24b
HEAD@{6}: commit: Changed Gemfile after reset
HEAD@{7}: reset: moving to FETCH_HEAD
HEAD@{8}: commit: Added Event Show page, Upload Event Pic
HEAD@{9}: commit: Add Category Database and Event pages
HEAD@{10}: merge adding_events: Fast-forward
HEAD@{11}: checkout: moving from adding_events to master
HEAD@{12}: commit: Replaced Post with Events

When I do git status on my master branch this is what comes up

Your branch and 'origin/master' have diverged,
and have 1 and 5 different commits each, respectively.

When I open the app in my directory the 12 commit "Replaced Post with Events" is the latest file shown. I'd like to get back to my last commit of 8 "Added the event Show page, Upload Event Pic"...any ideas?

Was it helpful?

Solution

You can do:

git reset --hard HEAD@{8}

to reset the current branch pointer to that specific commit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top