A
A
AllReady2018-03-03 19:41:14
git
AllReady, 2018-03-03 19:41:14

BitBucket Restore repository after git push -f origin master?

Good afternoon. There was such a problem. Cloned the project while making improvements - someone added a commit. When it came time to make changes, I tried to commit and showed that I need to do a git pull to get the changes. I didn’t figure it out a bit and accidentally ran the command: git push -f origin master. After that, all commits from the repository were erased. Is there any way to go back to a previous version?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2018-03-03
@SagePtr

Try git reset --hard origin/[email protected]{1}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question