GithubHelp home page GithubHelp logo

Comments (1)

samjabrahams avatar samjabrahams commented on August 17, 2024

Thanks for opening this up! The original command is actually correct in this scenario.

  • git checkout <commit> without a path specified will move the HEAD to that commit, effectively moving us back in time to that commit.
  • git checkout <commit> <path> will not move the HEAD. Instead it modifies all files needed to simulate the commit and stages those changes.

Although the result of both of these commands leads to identical file/directory contents, the status of the HEAD and staging area is drastically different. The first leaves the staging area clean, while the second fills it with all changes needed to revert the files to their previous state. Since we aren't looking to commit/revert these changes to master, it's better to simply checkout the old commit.

As an exercise, try running git checkout d5fb408d . in the Protobuf repository, and then try to get the working directory back to being clean again. If you simply run git checkout . (after unstaging the changes), you'll notice that there are several files that are no longer tracked and will have to be removed manually. In contrast, if you run git checkout d5fb408d, you are able to use the command git checkout master to get back to the original state.

I appreciate you double checking this, though!

from tensorflow-on-raspberry-pi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.