This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes GIT query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "GIT query" Watch "GIT query" New topic
Author

GIT query

Sahil Reddy
Ranch Hand

Joined: Jan 24, 2011
Posts: 145
Hello i am using git . I am stuck in following scenario .....


Assume --> My Local Machine STATE = X
GitHub STATE = Y
Initially --> I made a pull , so X == Y

1. I made some changes in my local machine. ( My Local Machine STATE = X' )
2. I made a commit followed by push on GitHub ( Github STATE = X')
3. Now i want to revert to a state where the repository was before i made my last pull from GitHub. ( I mean i want to switch back to state X and want Github state to be Y again )

How to achieve that ??

Essentially i want to remove the following'

1. Effect of my push on github.
2. My local machine state back to the point where i started making last changes.


Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5852
    
    7

Did you try "git reset"?
http://www.kernel.org/pub/software/scm/git/docs/git-reset.html


JBoss In Action
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: GIT query
 
It's not a secret anymore!