Forums Login/signup

How do I reverse all the git commands in Eclipse Ide?

+Pie Number of slices to send: Send
Today, I tried to upload my latest work to the git repository using the Team - a place for you to do your git command via terminal.

But, I am poor in my git commands so I ended up doing lots of commands but did not succeeded in uploading my work.  

Instead, now my files - java classes are all mixed up with local and remote pieces.

I can't post a picture here as it is quite blur.

Is there anyway to reverse everything so that it will return my original code ?

I can only think of using a new Eclipse ide and then import my saved copy.



+Pie Number of slices to send: Send
This is going to be messy.

Git is designed to allow you to make and archive changes locally and then merge them unto a remote repository. So the first thing you have to sort out is whether the remote repository has any of those loose-cannon changes. If not, then it's just your local system that needs cleaning up.

If you have uncommitted changes that you want to discard, there's a git command to back them out. If they are already committed, you might want to make a git branch off them. Then you should be able pull the good code from the remote, discarding the changes in the mainline branch. At that point you might want to spin off another branch from the clean remote copy, switch to the new branch, and judiciously merge the changes you want from your first branch. Then you should be in good shape to merge from the new branch back into the mainline. It's actually not a bad idea to work on branches rather than directly with the mainline code when you're working in a group anyway.

There's also something called a "git stash" that can be used to temporarily keep things while you're working it all out.

Note that I haven't mentioned any Eclipse options or git shell commands. That's because I'm still not sure exactly what you have.
+Pie Number of slices to send: Send
 

Tim Holloway wrote:This is going to be messy.

Git is designed to allow you to make and archive changes locally and then merge them unto a remote repository. So the first thing you have to sort out is whether the remote repository has any of those loose-cannon changes. If not, then it's just your local system that needs cleaning up.

If you have uncommitted changes that you want to discard, there's a git command to back them out. If they are already committed, you might want to make a git branch off them. Then you should be able pull the good code from the remote, discarding the changes in the mainline branch. At that point you might want to spin off another branch from the clean remote copy, switch to the new branch, and judiciously merge the changes you want from your first branch. Then you should be in good shape to merge from the new branch back into the mainline. It's actually not a bad idea to work on branches rather than directly with the mainline code when you're working in a group anyway.

There's also something called a "git stash" that can be used to temporarily keep things while you're working it all out.

Note that I haven't mentioned any Eclipse options or git shell commands. That's because I'm still not sure exactly what you have.



Er...I actually wanted to sort out all the mess the shortest time but now I think I ended up with a much bigger mess.

So, I actually copied to back-up copy to a new Eclipse IDE.

But, now, even after remove the .git folder, and then after rebuild my maven it is not able to build at all.

All it is giving me is


The requested profile "1" could not activated because it does not exist.



Is there anyway to make Maven build successfully in this case?

I have wasted the whole of yesterday and all these troubleshooting is making me so tired and then I still haven't figure out how to make the "continous testing" using shell script ....

Please advise me if there is a solution on the above.

Tks and belated Merry Christmas.
+Pie Number of slices to send: Send
Sorry I managed to get it build successfully after seeing what is the full error.

I think I always get caught up by the situation and then I will waste alot of time not able to make the errors go away.

Am I the only one like that ?

How does other developer always managed to handle this kind of situation, especially in tight deadline ?

Will the management knows and don't care ?

I hope you can still advise me on how to make the shell script how to make the API run in Postman continously without having to manually do a Post and then do another post etc etc.

Really thank you guys for helping me so much all these years.  

+Pie Number of slices to send: Send
Actually, your kind of problem used to be just a big an issue for me as it has been for you and in mostly the same ways. A couple of things have helped.

First, any serious project gets a git repository. Local repositories are cheap and easy (just do a "git init ." with no need to integrate into a server repository unless you need to.

Secondly, I run nightly backups. Ideally I've done a git commit at the end of each major bit of work, but just in case I timed things badly, I can pull the project from the nightly backup.

Third, in Eclipse, Eclipse itself keeps a limited change history, and that's often the best place to sort through and discard dead end code attempts.

As I said earlier, it's a good idea to make a git branch when doing new changes to a project. Although I'm very bad about not realizing I should have done that unless I've got a mess on my hands. That's where it's nice if you can stash your changes, back up the to good point, make a branch and merge good changes while discarding bad ones.

reply
reply
This thread has been viewed 341 times.
Similar Threads
Simple and clear Instruction for Git and version control
Problem with using several IDEs on the same machine
Git, nested projects, Eclipse
Thoughts on Git
How to Integrate local Git Repo with Remote Git Repo?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 30, 2025 19:31:29.