Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6234233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:26:52+00:00 2026-05-24T10:26:52+00:00

I am working on a regression in the source code. I’d like to tell

  • 0

I am working on a regression in the source code. I’d like to tell Git: “checkout the source based on a parameterized date/time”. Is this possible?

I also have staged changes in my current view that I don’t want to lose. Ideally, I would like to toggle back and forth between the current source, and some version I’m interested in based on a previous date.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:26:53+00:00Added an answer on May 24, 2026 at 10:26 am

    To keep your current changes

    You can keep your work stashed away, without commiting it, with git stash. You
    would than use git stash pop to get it back. Or you can (as carleeto said) git commit it to a separate branch.

    Checkout by date using rev-parse

    You can checkout a commit by a specific date using rev-parse like this:

    git checkout 'master@{1979-02-26 18:30:00}'
    

    More details on the available options can be found in the git-rev-parse.

    As noted in the comments this method uses the reflog to find the commit in your history. By default these entries expire after 90 days. Although the syntax for using the reflog is less verbose you can only go back 90 days.

    Checkout out by date using rev-list

    The other option, which doesn’t use the reflog, is to use rev-list to get the commit at a particular point in time with:

    git checkout `git rev-list -n 1 --first-parent --before="2009-07-27 13:37" master`
    

    Note the –first-parent if you want only your history and not versions brought in by a merge. That’s what you usually want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working Example: This is almost identical to code I use in another places on
Working with TCL and I'd like to implement something like the Strategy Pattern .
I would like to run a JUnit regression Test Suite from within an ANT
I'd like to do large-scale regression (linear/logistic) in R with many (e.g. 100k) features,
I'm working on a scientific computing code (written in C++), and in addition to
I am working on a forms application that reports based on observed data. Prior
I'm using Watir 1.6.7. I'm working on developing some regression tests for a PeopleSoft
Working on this EF tutorial , I've difficult to understand the meaning of the
Working on THIS Page: newsite.702wedding.com/live/ Can't find where to remove the arrows at the
Working through this for fun: http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/ Example calculation of nullable and first uses a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.