M
M
Mikhail Abroskin2016-05-16 20:18:09
git
Mikhail Abroskin, 2016-05-16 20:18:09

How to restore an overwritten commit on bitbucket?

Good day, Colleagues!
Need urgent help.
Today at work I completed a small project, or rather, not even a project, but a test task for a vacancy, committed everything, uploaded it to my bitbucket, and went home. Arriving home, I sat down at the computer, I had to make a couple more edits and send the assignment. And damn that I’m stuck, I don’t understand, I overheated the felts, I reworked it, I sit and think -
This is how I need to make a pool, and I write a push myself, the git swears they say do the pull first, since the rap has been changed, it’s as if something has been changed in my head, I push him force... and when the process can no longer be canceled, it dawns on me that I confused the push with the pool (((I don’t understand how this could happen at all.
As a result, the last commit was removed and everything returned to what it was before the edits. In the bitbucket on the tab with commits, there is no new commit, on the Overview tab in the latest changes, there is my last commit and after it the last entry is the deletion of this commit.
From the latest changes, I can go to that commit, there are all the changes, but I can’t catch up with how to restore it. There is an Approve button, but I don't understand what it's good for.
Actually the question is, help restore this commit, where do you need to click to apply it? I urgently need to send today, it’s clear that tomorrow at work I can commit again from my working computer, but today I need to

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Abroskin, 2016-05-16
@miker059

Phew, the issue was resolved very simply, thanks to everyone who was mentally with me.
Answer: On the Overview page, click the commit we need, on the commit page, click the View raw commit link, the patch file opens, save it to the project folder, by default the file name will be raw.txt, leave it or change it as you like. Next, go to the terminal and run in the project folder - git apply raw.txt (or if you changed your own), well, that’s all, the patch applied all the changes in place)) Thank you all))

E
evnuh, 2016-05-16
@evnuh

trygit cherry-pick хешкоммита

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question