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

前端 未结 3 1107
醉酒成梦
醉酒成梦 2021-01-29 17:00

I\'m in my local computer\'s master branch of a cloned master-branch of a repo from a remote server.

I updated a file, and I want to revert back to the original version

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 17:30

    I've faced same problem and came across to this thread but my problem was with upstream. Below git command worked for me.

    Syntax

    git checkout {remoteName}/{branch} -- {../path/file.js}
    

    Example

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

提交回复
热议问题