How to pull git from the server after modifying and deleting a file locally?
某草草2017-05-02 09:26:59
0
4
619
I cloned a copy of the project code locally Modified a.php I made too many changes and wanted to give up. I deleted a.php I wanted to pull a new copy of a.php , which was bloated. Yeah. It would be nice if svn didn’t just update it once! !
1. Enter the project folder through the terminal 2. Enter the command and execute: git checkout file path (including file name) At this time, the file has been restored to its unmodified state
git checkout -- a.php
or, don't care what file specifically
git checkout HEAD
or, you messed all things up
git reset --hard HEAD
Single file
git checkout a.php
git checkout a.php
当前目录
git checkout .
Current directorygit checkout .
🎜1. Enter the project folder through the terminal
2. Enter the command and execute: git checkout file path (including file name)
At this time, the file has been restored to its unmodified state
git checkout branch name -- the complete relative path of a.php, you can download the online branch code