SShortSingh.
Back to feed

Recovering Lost Git Commits: 12 Fixes for Common Mistakes

0
·3 views

A developer guide explains how to recover commits that appear lost after common Git errors, such as resets, deleted branches, or commits made on the wrong branch. The central tool is the reflog, which records past positions of HEAD and branch tips, so commits are usually only unreachable rather than gone. The guide notes that reflog entries expire, with defaults of 90 days or 30 days for unreachable commits, and that unreachable objects can be pruned by git gc after two weeks, making prompt action important. It is based on tests run on Git 2.56.0 in throwaway repositories. Fixes are provided for scenarios including accidental hard resets, deleted branches, detached HEAD commits, and merge or rebase mistakes.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

Eli Lilly CEO publicly disputes Anthropic chief Dario Amodei's claims about medical AI

The chief executive of Eli Lilly has reportedly pushed back against assertions made by Dario Amodei, head of AI company Anthropic, regarding medical advances. The criticism appears in a Substack post by researcher Gary Marcus, which was shared on Hacker News. The source material provided is limited to a link and basic engagement metadata, so the specific claims and rebuttal details could not be independently verified. The post characterizes Amodei's statements as ludicrous, though that framing reflects the commentary rather than a confirmed fact. Further reporting would be needed to establish the exact substance of the disagreement.

0
ProgrammingDEV Community ·

DIY IoT Gas Monitor Built With ESP8266 and MQ-2 Sensor Streams Data to Dashboard

A developer has built an IoT gas level monitoring system using an ESP8266 NodeMCU and an MQ-2 gas sensor. The sensor's analog output is read through the board's A0 pin and transmitted over Wi-Fi to the KiwisIoT platform. The readings are displayed on a dashboard using a Gauge widget, allowing remote monitoring. The project was programmed in Arduino IDE and sends new values roughly every two seconds. The author notes possible extensions such as buzzer alarms and alert notifications.

0
ProgrammingDEV Community ·

Using one VPN key on both PC and Mac: choosing compatible clients

The same VPN subscription can usually be used on both a Windows PC and a Mac, but the installer and import steps vary by operating system. Users should confirm that their chosen client supports their protocol on each platform and download the matching version rather than reusing an installer from another system. Official project documentation, such as a repository's list of supported systems, is recommended as the most reliable reference. The guidance also advises connecting on one computer first, testing a familiar site, and noting whether the app routes all traffic or only specific applications. A VPN cannot fix a suspended account, a game ban or a provider outage, and users should follow local law.

0
ProgrammingDEV Community ·

How to test a VPN key on your own network before relying on it

The article recommends testing a VPN key against the specific device and service that matters most, comparing results on the original connection and on mobile data. It advises installing a compatible client from an official source and avoiding unofficial repacks or sites that claim to validate keys. After importing the key, the reader should connect to a nearby location and repeat the original test while also checking normal browsing. The piece notes that a VPN cannot restore a suspended account, lift a ban, fix provider outages, or guarantee lower gaming ping, and it urges following local laws. It concludes that a short, controlled trial with recorded results gives more reliable evidence than a single screenshot.