Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

Friday, February 14, 2025

πŸš€ Oops! Pushed to develop by Mistake? Here’s a Quick Fix! πŸš€

πŸš€ Oops! Pushed to develop by Mistake? Here’s a Quick Fix! πŸš€
We've all been there—accidentally pushing changes to the develop branch instead of a feature branch. Before you panic, there's a simple way to undo it gracefully using Git.

πŸ”„ The Quick Fix
If you've mistakenly pushed your latest commit to develop, run the following command: 1️⃣ Save the commit/changes

Code Snippet


πŸ”Ή What does this do?
✅ Moves the latest commit to staged changes without deleting it.
✅ Allows you to fix things before re-committing or switching branches.

2️⃣ Discard the Commit Completely
If you want to undo the commit entirely (⚠️ This will remove all changes!):

Discard the Last Commit


πŸ”„ Next Steps
Switch to the Correct Branch and Recommit
If you meant to push the changes to a different branch:

Move Changes to Correct Branch


😊Like that we can revert our mistake😊

Wednesday, February 12, 2025

How to handle when code push accidently in deleted branch

Have you ever pushed your code, only to realize the branch was deleted? 😱 No worries—your work isn't lost! Git keeps a history of all commits, and you can easily recover your code.
πŸš€ Steps to Recover Your Deleted Branch
1️⃣ Check Your Git Log Even if a branch is deleted, the commits still exist. Run:

Code Snippet

This will show a list of commit hashes with their messages.
2️⃣ Find Your Last Commit Look for the commit related to your deleted branch
3️⃣ Restore Your Branch Once you have the commit hash, recreate the branch:

Code Snippet

Note : Instead of "abc1234" write "your hashcode" and "recovered-branch" write your "new branch name"

😊Now you can push your code in that branch and you can able to create PR.😊

πŸš€ Agentic Framework 1.0 in .NET: The Power Combo of Semantic Kernel + AutoGen

The AI landscape is shifting fast—from simple prompt-response systems to autonomous, decision-making agents . If you're still building b...