drnrxv9383
drnrxv9383
2015-10-03 13:43

Git - 忽略我在本地制作的最后更改

已采纳

I have made some changes in a file and I broke it at some point. I have all the version control in bitbucket.

When I try: git status, I get modified:resources/views/app.blade.php however I don't want to commit it, instead I wanna bring back the working version. I didn't push the broken version, so the last one on git is the working version.

What is the command necessary for me to ignoring all the last changes I have made on my local?

Will git pull origin working branch work? I want to ignore all the latest changes that I made on my local for only that single file (app.blade.php) that I didn't push yet, and pull the latest working version from git.

Something like git ignore last changes that I made on app.blade.php & pull the working version of app.blade.php the latest pushed version on git is the working one, i didn't push broken one.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dqdjfb2325 dqdjfb2325 6年前
    git checkout -- .
    

    will undo all non-committed local changes

    git checkout -- <file> 
    

    will undo all non-committed local changes to file

    点赞 评论 复制链接分享

相关推荐