0

This morning, I logged into my production server and accidentally delete one of my file.

UrlController.php

Unfortunately, there is no undo in WinSCP. As soon as you hit on the red X, it gone for good.

Fortunately, I use git. When I do git status, this is what I see.

enter image description here

Is there anywhere to use git to bring that file back, or undo what I just delete ?

I'm new to git. Feel free to suggest a better option. Thanks.

1

1 Answer 1

2

Try this:

$ git checkout app/controllers/UrlController.php
Sign up to request clarification or add additional context in comments.

4 Comments

after doing git checkout, what else should I do ?
@evoque2015 That should undo the deletion completly, so there is nothing further to be done.
I always use git checkout -- <filename> to distinguish it from any other git checkout commands.
@Agis : It's work. So checkout will always bring back the file ? just curious ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.