search

Home  >  Q&A  >  body text

How to pull git from the server after modifying and deleting a file locally?

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! !

某草草某草草2781 days ago607

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:28:59

    git checkout -- a.php

    or, don't care what file specifically

    git checkout HEAD

    or, you messed all things up

    git reset --hard HEAD

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:28:59

    Single file
    git checkout a.phpgit checkout a.php
    当前目录
    git checkout .Current directory

    git checkout .🎜

    reply
    0
  • ringa_lee

    ringa_lee2017-05-02 09:28:59

    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

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:28:59

    git checkout branch name -- the complete relative path of a.php, you can download the online branch code

    reply
    0
  • Cancelreply