How to revert to origin’s master branch’s version of file

How to revert to origin’s master branch’s version of file

Asked on January 8, 2019 in Git.
Add Comment


  • 2 Answer(s)

    Not execute the file,

    git checkout -- filename
    

    Added it to the index,

    git reset HEAD filename
    git checkout -- filename
    

    Perform it,

    git checkout origin/master filename
    

    All apply from your branch

    git reset --hard origin/master
    

     

    Answered on January 8, 2019.
    Add Comment

    To origin’s master branch’s.

    Syntax;

    git checkout {remote-name}/{branch} — {file/path.js}

    Example:

    git checkout upstream/develop — public/js/index.js

    Answered on January 8, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.