R
R
RabIN2019-01-23 19:50:51
git
RabIN, 2019-01-23 19:50:51

How to recover files from a previous commit (3 commits ago) in phpstorm?

How to restore files from a previous commit (3 commits ago) in phpstorm?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Antony Tkachenko, 2019-01-23
@LemonFox

Try via console

//Откатиться до комита с хешем <commit_hash>
git reset --hard <commit_hash>
//Откатиться на 3 коммита назад
git reset --hard HEAD~3
//Временно вернутся к состоянию коммита с хешем
git checkout <commit_hash>
//Создать новую ветку из коммита
git checkout -b <branch_name> <commit_hash>

D
doctorcat, 2019-01-23
@doctorcat

git checkout commit_name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question