Reputation: 1415
Hello i reverted a git commit called "Add user microposts".
I didn't mean to do it. I thought revert ment to go back to this version. But it actually means to get undo everything in that commit.
How do i get it back?
You can see what i did below.
Upvotes: 0
Views: 518
Reputation: 689
Best way is git cherry-pick 4a593
, assuming that's the hash that corresponds to your original commit. This will re-apply the commit on top of your codebase, undoing the revert.
Upvotes: 0
Reputation: 9747
Assuming the commit that you did as a revert is last commit that you have, you can remove that:
git reset --hard HEAD^
It will delete your last commit and will give the changes back.
Upvotes: 3
Reputation: 3881
if you want it back, you can revert the revert
git revert <commit>
Upvotes: -1